[Theme Elegance] Bullets gone!

[Theme Elegance] Bullets gone!

par Visvanath Ratnaweera,
Nombre de réponses : 16
Avatar Particularly helpful Moodlers Avatar Translators

Moodle Moodle 3.1.5+ (Build: 20170331) Theme Elegance, release 3.1.0, version 2016081500

Simple annoyance, possibly a well-known one. HTML lists (ul) are rendered with bullets in the Editor (TinyMCE) but not in the end product.

The code:

Edit: Noticed that Bootstrap has the same problem, but not More.
Annexe listscode.png
Moyenne des évaluations  -
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Richard Oelmann,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers

Just noting that Elegance and Bootstrap (the theme, rather than the framework) are Bootstrap3 themes and have some differences to Clean and More (BootstrapBase) which are based on Bootstrap2.

En réponse à Richard Oelmann

Re: [Theme Elegance] Bullets gone!

par Visvanath Ratnaweera,
Avatar Particularly helpful Moodlers Avatar Translators
Hi Richard

Do you mean, this is the anticipated result? If yes, do I have to provide special CSS? (Users have seen the bullets in the editor and expect the same in the result.
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Mary Evans,
Avatar Core developers Avatar Documentation writers Avatar Peer reviewers Avatar Plugin developers Avatar Testers

Hi Visvanath,

EDITED: Sorry I missed seeing the version in your first post earlier.

My Computer crashed the other day so am flitting between computer updates to Moodle Themes on my iPad!

Which version of Moodle are you currently using?

I've added some missing CSS  rules in Moodle for this sort of thing over the years, so could need updating again...seems a bit odd though???

Unless Elegance is blocking them?

CSS is...as follows and there is nothing fancy about it, but it tends to be in the useragent as it is common to all. The problems tend to be when different levels are needed...but generally this is all that is needed.

ul { list-style-type: square;}

Sorry for interupting the discussion.

Cheers

Mary

Moyenne des évaluations Useful (1)
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Richard Oelmann,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers

If  I remember correctly, there is a bug(?)/feature(?) in the less in the bootstrap theme that applies a 'none' as the bullet type, so you probably need to add something like

ul {list-style: outside none circle;}
to your css - although it probably needs to be more specific to avoid bulleting other things that are treated as <ul> elements in Moodle.
Looking it up in one of my themes it looks like I added

.course-content li.section li.activity ul {list-style: outside none disc;}
Hope that helps

Richard


Moyenne des évaluations Useful (1)
En réponse à Richard Oelmann

Re: [Theme Elegance] Bullets gone!

par Visvanath Ratnaweera,
Avatar Particularly helpful Moodlers Avatar Translators
Hi Mary, hi Richard

Thanks for the clarifications. It has to be CSS then.\?

Well, I thought something as simple as
ul { list-style-type: square;}
should show some result, I thought. No response though, unfortunately.

I had a look with FireBug, the divs responsible for my trial list is shown below, in case Elegance has a different style structure:
Annexe yui-1.png
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Visvanath Ratnaweera,
Avatar Particularly helpful Moodlers Avatar Translators
There is more to it than mere CSS(?).

If I give a custom CSS like
.course-content li.section li.activity ul {list-style: outside none disc; color: red;}
the list gets the color, but not the bullets. (See the screen shot below.)
Annexe red-bullet.png
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Mary Evans,
Avatar Core developers Avatar Documentation writers Avatar Peer reviewers Avatar Plugin developers Avatar Testers

From memory you cannot colour a bullet as they do not respond to text colour, you need to add an image.

En réponse à Mary Evans

Re: [Theme Elegance] Bullets gone!

par Visvanath Ratnaweera,
Avatar Particularly helpful Moodlers Avatar Translators
I am trying to get the _bullets_, in whatever color!
clin d’œil

I colored the text to prove that I am not doing something fundamentally wrong.
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Richard Oelmann,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers

Well, the colour shows you have the right selector, so are you able to use firebug or chrome developer tools to make sure that there isn't an !important or something else overriding the styles for the bullet itself?

En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

par Mary Evans,
Avatar Core developers Avatar Documentation writers Avatar Peer reviewers Avatar Plugin developers Avatar Testers

You need something like

ul,
ul ul,
ul ul ul,
ul ul ul ul,
ul ul ul ul ul
{ list-style-type: square !important; list-style-position: outside !important; list-style-image: none !important;
}

Which will cover sub-menu lists as well as just top level lists.

Try adding that to the CSS custom setting in the Elegance theme.

Cheers

Mary

En réponse à Mary Evans

Re: [Theme Elegance] Bullets gone! SOLVED

par Visvanath Ratnaweera,
Avatar Particularly helpful Moodlers Avatar Translators
Hi Mary, hi Richard

Sorry, my CSS is rusty, or this YUI beats me (or both).
triste

First the selector: I am convinced that
.course-content li.section li.activity ul
is the right one.
ul, ul ul, ul ul ul, ul ul ul ul, ul ul ul ul ul
touches just too many things, as found out with my red paint method.

The properties: I tried
{list-style-type: circle !important; list-style-position: outside; list-style-image none; }
and other variations of it. No reaction.

I find FireBug doesn't tell me much about the CSS cascades. May be, I don't understand it. So, I am still stuck.

Edit: 'list-style-position: inside;' rather than 'list-style-position: outside;' gives me an acceptable solution (see screen-shot). So the final solution is
.course-content li.section li.activity ul {list-style-type: disc; list-style-position: inside; list-style-image none; }
. Thank you both for all your support!
Annexe bullet-inside.png
En réponse à Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone! SOLVED

par Mary Evans,
Avatar Core developers Avatar Documentation writers Avatar Peer reviewers Avatar Plugin developers Avatar Testers

Well glad someone is happy today!

LOL

Mary

En réponse à Mary Evans

Re: [Theme Elegance] Bullets gone! SOLVED

par Visvanath Ratnaweera,
Avatar Particularly helpful Moodlers Avatar Translators
Well, it needed a bit more. This is the final version:
.course-content li.section ul {list-style-type: disc; list-style-image none; padding-left: 17px; }
.course-content li.section ol {list-style-type: decimal; list-style-image none; padding-left: 17px; }
.course-content li.section li.activity ul {list-style-type: disc; list-style-image none; padding-left: 17px; }
.course-content li.section li.activity ol {list-style-type: decimal; list-style-image none; padding-left: 17px;}


So, ultimately no list-style-position at all, otherwise a long list item gives a not-so-nice line-breaks.
Annexe newlist.png