The Omega family is a group of mixins that accomplish several supplemental goals within the Bourbon-Neat framework.
Originally created to address: thoughtbot/neat#543
npm install --save neat-omega
- add
@import neat-omega
after your@import neat
statement in your scss. - add
node_modules/neat-omega/core
to your sass import paths.
bower install neat-omega
- add
@import neat-omega
after your@import neat
statement in your scss. - add
bower_components/neat-omega/core
to your sass import paths.
- add
gem "neat-omega"
to Gemfile - add
@import neat-omega
after your@import neat
statement in your scss.
@include alpha($selector: self, $grid: $neat-grid)
- Clears the float on the specified selector. Generally this is the first item in a new row.
example SCSS
.element:nth-child(3n+1) {
@include alpha;
}
example CSS
.element:nth-child(3n+1) {
clear: left;
}
example SCSS
.last-element {
@include alpha('&:last-child');
}
example CSS
.last-element:last-child {
clear: left;
}
example SCSS
@include alpha('.custom:nth-child(3n+2)');
example CSS
.custom:nth-child(3n+2) {
clear: left;
}
@include nth-alpha($selector, $grid: $neat-grid)
- Clears the float on the specified
nth-of-type
selector. This is mostly for convenience, since you can achieve the same result withalpha
example SCSS
.nth-element {
@include nth-alpha(4n+1);
}
example CSS
.nth-element:nth-of-type(4n+1) {
clear: left;
}
@include omega($selector: self, $grid: $neat-grid)
- Adds a margin-right to the specified selector. Generally this is only needed for centered flex layouts.
example SCSS
@include omega('.element:nth-of-type(3n+2)');
example CSS
.element:nth-of-type(3n+2) {
margin-right: 20px;
}
example SCSS
element {
@include omega('&:nth-of-type(3n+1)');
}
example CSS
.element:nth-of-type(3n+1) {
margin-right: 20px;
}
@include omega-flex($selector: null, $grid: $neat-grid)
- Adds a margin right to the specified object, or if auto, to the last child of the grid.
example SCSS
.element {
@include omega-flex;
}
example CSS
.element {
margin-right: 20px;
}
example SCSS
@include omega-flex('.element:nth-of-type(3n+2)');
example CSS
@example css - CSS Output
.element:nth-of-type(3n+2) {
margin-right: 20px;
}
example SCSS
.element {
@include omega-flex('&:nth-of-type(3n+1)');
}
example CSS
@example css - CSS Output
.element:nth-of-type(3n+1) {
margin-right: 20px;
}
example SCSS
.element {
@include omega-flex(auto);
}
example CSS
@example css - CSS Output
.element:last-child {
margin-right: 20px;
}
@include nth-omega($selector, $grid: $neat-grid)
- Adds a margin right to the specified
nth-of-type
object, and clears thenth+1
object. Note that composite arguments such as2n+1
are not supported by this mixin.
example SCSS
.nth-element {
@include nth-omega(4n);
}
example CSS
.nth-element:nth-child(4n) {
margin-right: 20px;
}
.nth-element:nth-child(4n+1) {
clear: left;
}
.nth-element:last-child {
margin-right: 20px;
}