Created
August 19, 2012 22:49
-
-
Save lucadegasperi/3398306 to your computer and use it in GitHub Desktop.
Context Based CSS Examples
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
.titlebar | |
{ | |
/* titlebar css rules go here */ | |
} | |
.titlebar .button | |
{ | |
/* button's titlebar context modified rules go here */ | |
} |
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
.button | |
{ | |
/* button css rules go here */ | |
} | |
.titlebar .button | |
{ | |
/* button's titlebar context modified rules go here */ | |
} |
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
.button | |
{ | |
/* default css rules go here */ | |
} | |
.titlebar .button | |
{ | |
/* titlebar context rules go here */ | |
background: red; | |
} | |
.sidebar .button | |
{ | |
/* titlebar context rules go here */ | |
background: red; | |
} | |
.modal-box .button | |
{ | |
/* titlebar context rules go here */ | |
background: red; | |
} |
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
.button | |
{ | |
/* default css rules go here */ | |
} | |
.titlebar .button | |
{ | |
/* titlebar context rules go here */ | |
} |
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
<div class="titlebar"> | |
<a class="button" href="#">I'm a different button</a> | |
</a> | |
<a class="button" href="#">I'm the default button</a> |
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
.button | |
{ | |
/* default css rules go here */ | |
} | |
.button.different | |
{ | |
/* different css rules go here */ | |
} |
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
<div class="titlebar"> | |
<a class="button different" href="#">I'm a different button</a> | |
</a> | |
<a class="button" href="#">I'm the default button</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment