Skip to content

Instantly share code, notes, and snippets.

View nonlinear's full-sized avatar

Nicholas Frota nonlinear

View GitHub Profile
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
// Instead of doing this
@mixin svg-after($name) {
&:after {
@include svg($name);
}
}
@mixin svg-before($name) {
&:before {
@include svg($name);
@imjared
imjared / bootstrap-breakpoints.scss
Last active August 16, 2016 10:13
scss breakpoint helpers based on bootstrap
// breakpoint helpers based on bootstrap's breakpoints
@mixin xs {
@media #{screen} and (max-width: #{$screen-xs-max}) {
@content;
}
}
@mixin sm {
@media #{screen} and (min-width: #{$screen-sm-min}) and (max-width: #{$screen-sm-max}) {
@soderalohastrom
soderalohastrom / Absolute_centerer.scss
Created June 22, 2014 01:18
Center horizontally and vertically
@mixin centerer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@YamilG
YamilG / center-center.scss
Created June 16, 2014 05:08
Center center percentage + full screen block something
@mixin coverer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
@mixin centerer {
position: absolute;
@mixin word-wrap() {
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@dieppon
dieppon / ie-height.scss
Created April 10, 2014 14:43
Cross-browsing min/max heights
@mixin min-height($value){
height: auto !important;
height: $value;
min-height: $value;
}
@mixin max-height($value){
height: auto !important;
height: $value;
max-height: $value;
@mixin subclass ($superclass) {
.#{ $superclass },
[class^="#{ $superclass }-"],
[class*=" #{ $superclass }-"] {
@content;
}
}
@lisasy
lisasy / _equal-gutter.scss
Created March 2, 2014 23:39
_equal-gutter.scss
@mixin equal-gutter($direction: top, $value: 1em) {
padding-#{$direction}: $value;
margin-#{$direction}: $value;
}