Build components in easy way
npm install jons-modular-uiUse NPM to install: npm install jons-modular-ui.
In Rails you can add to vendor path directly and request the index.css in application.css. If you not use Rails or other automatic preprocessor, you need compile with Sass.
.MyComponent {}
.MyComponent.is-animating {}
.MyComponent--modifier {}.MyComponent-part {}
.MyComponent-anotherPart {}
`Structure of components with Sass
`
@import 'variables';.Container{
background: $color-container;
border-radius: $container-radius;
overflow: auto;
padding: 0 15px;
box-shadow: $container-shadow;
&-heading{
display: inline-block;
margin: 0 0 12px 0;
& h2{
font-size: 18px;
}
}
&-body{
display: block;
padding: 6px 0;
}
&-footer{
padding: 12px 0;
}
}
`Using modular media-queries in components
`
.Section{
padding: 0 0 35px 0; &-header{
padding: 15px 0 10px;
}
&-title{
text-align: left;
float: left;
@include mobile{
text-align: center;
float: none;
};
&:hover{
color: $grey;
text-decoration: underline;
}
}
`$3
desktop: min-width: 1200pxtablet: min-width: 900px and max-width: 1199mobile: min-width: 1px and max-width: 899pxlg-mobile: min-width: 425px and max-width: 899pxsm-mobile: min-width: 1px and max-width: 424pxUsing Grids
`
Meu conteudo ou divs
Meu conteudo ou divs
`$3
Grid: core componentGrid--alignCenter: center-align all child Grid-cellGrid--alignRight: right-align all child Grid-cellGrid--alignMiddle: middle-align all child Grid-cellGrid--alignBottom: bottom-align all child Grid-cellGrid--fit: evenly distribute space amongst all child Grid-cellGrid--equalHeight: all child Grid-cell match height of the tallestGrid--withGutter: adds a gutter between cellsGrid-cell: a child cell of Grid that wraps grid contentGrid-cell--center: center an individual Grid-cellRequire dependencies or other components
`
/ npm-installed dependency /
@import "suitcss-utils-text";
/ local dependency /
@import "./Button";.MyComponent {}
``Fork from https://suitcss.github.io/