Skip to content

Instantly share code, notes, and snippets.

Created December 31, 2012 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4417536 to your computer and use it in GitHub Desktop.
Save anonymous/4417536 to your computer and use it in GitHub Desktop.
scalable components 1: tips. Usage: <div class="tips">Contents goes here</div> with your own style: .tips { font-size: 150%; }. Define color below.
/* define color from inside to outside */
bg-color = white
border-color = grey
shadow-color = #ccc
.tips
/* layout */
z-index: 0
position: absolute
/* presentation */
padding: 0.8em 1.2em
border: 1px solid border-color
border-radius: 0.25em
box-shadow: 0 0 0.5em shadow-color
.tips::after
content: ''
z-index: -2
position: absolute
top: 0
left: 0
top: -0.5em
left: 1em
-webkit-transform: rotate(45deg)
-moz-transform: rotate(45deg)
transform: rotate(45deg)
width: 1em
height: 1em
border: 1px solid border-color
background-color: bg-color
box-shadow: 0 0 0.5em shadow-color
.tips::before
content: ''
z-index: -1
position: absolute
top: 0
left: 0
width: 100%
height: 100%
background-color: bg-color
border-radius: 0.25em
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment