[Theme Elegance] Bullets gone!

[Theme Elegance] Bullets gone!

by Visvanath Ratnaweera -
Number of replies: 16
Picture of Particularly helpful Moodlers Picture of 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.
Attachment listscode.png
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of 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.

In reply to Richard Oelmann

Re: [Theme Elegance] Bullets gone!

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of 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.
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of 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

Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of 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


Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: [Theme Elegance] Bullets gone!

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of 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:
Attachment yui-1.png
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of 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.)
Attachment red-bullet.png
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

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

In reply to Mary Evans

Re: [Theme Elegance] Bullets gone!

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I am trying to get the _bullets_, in whatever color!
wink

I colored the text to prove that I am not doing something fundamentally wrong.
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of 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?

In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone!

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of 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

In reply to Mary Evans

Re: [Theme Elegance] Bullets gone! SOLVED

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Mary, hi Richard

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

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!
Attachment bullet-inside.png
In reply to Visvanath Ratnaweera

Re: [Theme Elegance] Bullets gone! SOLVED

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Well glad someone is happy today!

LOL

Mary

In reply to Mary Evans

Re: [Theme Elegance] Bullets gone! SOLVED

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of 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.
Attachment newlist.png