Styling elements based on content text length
Presenter assigns CSS classes to all containers, based on the amount of text in them. It counts the characters contained and adds classes textlength-over-*
in steps of 50 characters - so you’ll find CSS classes called textlength-over-50
, textlength-over-100
and so on.
You can use these classes to create CSS rules that change formatting for longer pieces of text. For example, the default themes keep text centered until it is over 50 characters long. Then, it is aligned left.
For advanced flexibility, the classes are assigned to “outer elements” like the whole enumeration as well as each single enumeration item.
Example
The following CSS code aligns all elements with more than 50 characters of text in them left.
.textlength-over-50 {
text-align: left;
}