/* Colored button, label */
div.m-button a, .m-label { color: var(--button-background-color); }
+div.m-button.m-flat a { color: var(--color); }
+div.m-button.m-flat a:hover, div.m-button.m-default a:focus, div.m-button.m-default a:active {
+ color: var(--link-active-color);
+}
div.m-button.m-default a, .m-label:not(.m-flat).m-default { background-color: var(--default-color); }
div.m-button.m-primary a, .m-label:not(.m-flat).m-primary { background-color: var(--primary-color); }
div.m-button.m-success a, .m-label:not(.m-flat).m-success { background-color: var(--success-color); }
To highlight important links such as file download, you can style them as
buttons. Use :css:`.m-button` CSS class together with desired color class on an
-:html:`<a>` tag. The button is by default centered, apply a :css:`.m-fullwidth`
-class to it to display it as a full-width block with center-aligned label.
+:html:`<a>` tag. Use :css:`.m-flat` instead of a color class to make the button
+flat. It is then styled similarly to a link, but with bigger padding around.
+The button is by default centered, apply a :css:`.m-fullwidth` class to it to
+display it as a full-width block with center-aligned label.
.. code-figure::
<div class="m-col-m-3 m-col-s-6">
<div class="m-button m-dim m-fullwidth"><a href="#">Dim button</a></div>
</div>
+ <div class="m-col-m-3 m-col-s-6">
+ <div class="m-button m-flat m-fullwidth"><a href="#">Flat button</a></div>
+ </div>
</div>
You can put two :html:`<div>`\ s with :css:`.m-big` and :css:`.m-small` CSS
`Button links`_
===============
-Use :rst:`.. button-default::`, :rst:`.. button-primary::` etc. directives to
-create a `button link <{filename}/css/components.rst#button-links>`_. Directive
-argument is the URL, directive contents are button title. Use the :rst:`:class:`
-option to specify additional CSS classes. Use two paragraphs of content to
-create a button with title and description.
+Use :rst:`.. button-default::`, :rst:`.. button-primary::` etc. or
+:rst:`.. button-flat::` directives to create a
+`button link <{filename}/css/components.rst#button-links>`_. Directive argument
+is the URL, directive contents are button title. Use the :rst:`:class:` option
+to specify additional CSS classes. Use two paragraphs of content to create a
+button with title and description.
.. code-figure::
class DimButton(Button):
style_class = 'm-dim'
+class FlatButton(Button):
+ style_class = 'm-flat'
+
def register():
rst.directives.register_directive('transition', Transition)
rst.directives.register_directive('button-danger', DangerButton)
rst.directives.register_directive('button-info', InfoButton)
rst.directives.register_directive('button-dim', DimButton)
+ rst.directives.register_directive('button-flat', FlatButton)
Second text.</div>
</a>
</div>
+<div class="m-button m-flat">
+<a href="#"><span>Flat button</span></a>
+</div>
<!-- /content -->
</div>
</div>
First text.
Second text.
+
+.. button-flat:: #
+
+ Flat button