Contextual
The contextual module provides you with simple tags, marks and highlights for your pages, allowing you to easily emphasize parts of your text. The contextual alerts aim to replace the commonly used modal dialog design paradigm with a more modern one. HTML5 elements and simple rules are used in order to make important messages and pieces of content stand out easily.
All examples showcased refer to the mini-default flavor, some class names and styles might differ based on the flavor you're using.
@@ -51,7 +51,7 @@Quick overview
@@ -66,7 +66,7 @@Text highlighting
Alerts
Notes
- Alert elements do not have any pre-defined behavior. You should use your own Javascript code and interactive HTML elements to deal with showing and hiding them as necessary. +
- If you want to make your alerts more accessible, we suggest you add either the
role="alert"
attribute or therole="alertdialog"
attribute, depending on the behavior you are planning to implement for your alerts.
Animated alerts
Tooltips
Hover over this text to see a tooltip!
+
Hover over this text to see a reverse tooltip!
+
Tooltips can be used to convey context-sensitive information when the user hovers over some text. To create a tooltip, simply wrap the text you want users to hover over in an element with the .tooltip
class (our choice is usually a <span>
element, but your needs may differ) and add an aria-label
in that element, setting its value to the content of your tooltip. Tooltips display at the top of the hovered text by default, so if you want to show them below the text, add the .bottom
class to them.
Sample code
+<span class="tooltip" aria-label="This is a tooltip">Hover over this text to see a tooltip!</span> +<span class="tooltip bottom" aria-label="This is a tooltip">Hover over this text to see a reverse tooltip!</span>+
Notes
+-
+
- Tooltips are built to be accessible and should display properly on screenreaders. +
- If you are not satisfied with the default tooltip colors, please check out the customization page for instuctions on how to create your own tooltip variants. +
- Rembmer to always add the
aria-label
attribute, otherwise your tooltip will not have any text to show.
+
If you want to learn more about mini.css's modules, go back to the modules page and choose another module to see its documentation.
- The separators between breadcrumbs are added using some tricky CSS rules. Due to that, there might be a few browser versions or devices where you can see part of the seams between the element separators.
- Breadcrumbs show a hierarchy, an ordered list. However, we do not use the
<ol>
element, as it might conflict with some custom styles we've seen people use.
+ - If you want to add some accesibility to your breadcrumbs, you can add the
role="navigation"
attribute, although it is not required.