Created
December 31, 2014 04:40
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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