The maat.css modules do not provide you with UI and design out of the box, instead, it provides you with a solid architectural baseline upon which to complete your own work. Every module can be replaced, ignored or extended so it doesn't limit you when new strategies or technologies arise.
Add Maat.css package to your package.json.
npm install @freshheads/maatcss
Once you have maat.css in your project you first need to copy the example.main.scss file into your project directory structure and rename this to your application entry point. This file accesses the maat.css modules, and you can extend it with your own UI component modules.
The imports in this file need to be changed to the location of the maatcss node module. e.g. ~maatcss/generic/toplevel
when using Webpack. For example:
// Libs
@import '~sass-mq';
@import '~normalize.css';
// Tools
@import '~@freshheads/maatcss/tools/button-variant';
@import '~@freshheads/maatcss/tools/fontello';
// Generic
@import '~@freshheads/maatcss/generic/reboot';
@import '~@freshheads/maatcss/generic/toplevel';
@import '~@freshheads/maatcss/generic/typography';
// Layout
@import '~@freshheads/maatcss/layout/container';
@import '~@freshheads/maatcss/layout/layout';
@import '~@freshheads/maatcss/layout/layout-sizing';
@import '~@freshheads/maatcss/layout/layout-align';
// Components
@import '~@freshheads/maatcss/components/button';
@import '~@freshheads/maatcss/components/form';
@import '~@freshheads/maatcss/components/form-choice';
@import '~@freshheads/maatcss/components/form-select';
Maat.css follows a specific directory structure, which you hopefully follow as well in your own CSS directory:
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae
, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
The layout is based on flexbox which gives us a lot of nice features right out of the box. The layout columns below with the text "auto" do not specify any widths, they just naturally space themselves equally and expand to fit the entire row.
When equal widths aren’t what you want, you can add sizing classes to individual columns. Columns without sizing classes simply divide up the remaining space as normal.
The sizing class are set by breakpoint and the layout will change accordingly.
No gutter by setting .layout--no-gutters
Columns can also have an offset by defining .layout__item--offset-md-2
Layout components are infinitely nestable inside of other layout components.
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur cumque eum excepturi laudantium magnam provident qui ratione saepe totam unde. Est eum molestiae odit placeat quas rerum velit. Dignissimos, odit!
By default columns are stacked on mobile if you wish to overwrite this set the class .layout--no-wrap
. Or set a sizer on the xs class on the column you don't want to go full witdh.
You can make columns stretch to equal height by setting the class .layout--item-flex
on the layout or per column by setting .layout__item-flex
. This makes use of flexbox property where direct childs will be divided in rows
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur cumque eum excepturi laudantium magnam provident qui ratione saepe totam unde. Est eum molestiae odit placeat quas rerum velit. Dignissimos, odit!
Vertical alignment helpers, based on the complete layout. .layout--align-x
eg. top, middle or bottom
Vertical alignment helpers, defined per column. .layout__item--align-x
eg. top, middle or bottom
Horizontal alignment helpers. .layout--align-x
eg. center, right, between, around
You can change the order of columns on a from a certain breakpoint by setting .layout__item--order-md-x
eg. first, last. Or even reverse the complete layout by setting .layout--order-lg-reverse
You can set a grow and shrink modifier on layout items. To collapse these until a certain breakpoint use .layout--collapse-sm
Voornaam | Achternaam | Username |
---|---|---|
Geert | van de Langenberg | @G33RT |
Martin | Broos | @martinbroos |