Stylus Material offers multiple variables to use in media queries based on these two
breakpoints: $medium-and-up, $large-and-up, $small-and-down,
$medium-and-down, and $medium-only.
nav
sm-navbar($bgcolor: $primary-color, $font-color: $light-text-color, $padding: 8px,
$use-container: true, $title-tag: "h1", $align-right: true, $fixed: true, $title-size = 1.25 rem
)
Cards
This title is overlayed
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua.
Stylus Material is a stylus-based adaption of the
Materialize material design framework. It is built on 3
principles:
Define style in stylesheets, not as HTML or JavaScript
Only add css that is actually used
Convention over configuration
To achieve these, Stylus Material is fully functional without javascript (reload this page with
JavaScript disabled to see what it looks like). It consists of Stylus Mixins only,
each completely customizable but with a set of sensible defaults. Mixins are written in a way
that does not require littering the HTML document with a lot of new classes, using HTML5
elements instead.
Installation
Via Stylus
The preferred way to use Stylus Material is to install it via npm and
@require it in Stylus. You can theoretically require only selected components, but
given that Stylus Material is written completely as Mixins your CSS files will only contain
whatever you actually used anyways.
As CSS
Additionally, there are two precompiled versions that are not fully compliant with the libraries
philosophy but don't require stylus. Both can be found in the root folder.
The classes.min.css file defines classes similar to how most other frameworks do it.
The tags.min.css sets material styles on HTML 5 tags.
Usage
Both Stylus and CSS uses are explained for each component in this document. Futhermore if
you use the Stylus version you will most likely want to initialize global CSS by calling
sm-init() and include the Roboto font.
Here's a full version with all parameters for sm-init():