Skip to content

Instantly share code, notes, and snippets.

@mjlescano
Created December 31, 2014 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjlescano/f72fd1d8a8891c0235de to your computer and use it in GitHub Desktop.
Save mjlescano/f72fd1d8a8891c0235de to your computer and use it in GitHub Desktop.
Guides for working with css. Mixins to creates guides like the ones from photoshop.
@mixin css-guide {
content: '';
position: absolute;
opacity: 0.3;
background-color: cyan;
}
@mixin css-guide-h {
@include css-guide;
left: 0;
top: 50%;
width: 100%;
height: 1px;
}
@mixin css-guide-v {
@include css-guide;
left: 50%;
top: 0;
width: 1px;
height: 100%;
}
css-guide()
content ''
position absolute
opacity 0.3
background-color cyan
css-guide-h()
left 0
top 50%
size 100% 1px
css-guide()
css-guide-v()
left 50%
top 0
size 1px 100%
css-guide()
html.guides {
&::before {
@include css-guide-h;
}
&::after {
@include css-guide-v;
}
body {
&::before {
@include css-guide-v;
left: 38.2%;
background-color: darken(cyan, 50%);
}
}
}
html.guides
&::before
css-guide-h()
&::after
css-guide-v()
body
&::before
css-guide-v()
left: 38.2%
background-color: darken(cyan, 50%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment