Last active
August 29, 2015 14:17
-
-
Save craigmdennis/77a0615db0f5607ff103 to your computer and use it in GitHub Desktop.
Some helpful CSS tricks
This file contains hidden or 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
// Show pointer on labels to indicate clickability | |
label { | |
cursor: pointer; | |
} |
This file contains hidden or 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
// Show help cursor over abbreviations | |
abbr { | |
cursor: help; | |
} |
This file contains hidden or 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
// Hide empty paragraphs | |
// Very useful in WYSIWYG editors | |
p:empty { | |
display: none; | |
} |
This file contains hidden or 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
// Inherit the parent's border colour | |
// http://stackoverflow.com/a/24025056/394419 | |
* { | |
border-color: inherit; | |
} |
This file contains hidden or 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
// Reset box sizing | |
// https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ | |
html { | |
box-sizing: border-box; | |
} | |
*, | |
*:before, | |
*:after { | |
box-sizing: inherit; | |
} |
This file contains hidden or 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
// Colour an SVG the same as the text colour | |
// https://css-tricks.com/cascading-svg-fill-color/ | |
svg { | |
fill: currentColor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment