Created
May 5, 2013 21:59
-
-
Save kizu/5522353 to your computer and use it in GitHub Desktop.
liquid sidebar with centered content prototype
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
/* liquid sidebar with centered content prototype */ | |
body { | |
font: 24px Arial, sans-serif; | |
} | |
.a { | |
margin: 3em auto 0; | |
max-width: 22em; | |
box-shadow: 0 0 0 1px lime; | |
} | |
.b { | |
max-width: 10em; | |
margin: 0 6em 0 auto; | |
box-shadow: 0 0 0 1px red; | |
} | |
/* Context prototype */ | |
.context { | |
display: inline; | |
} | |
.context__item { | |
display: inline; | |
color: inherit; | |
text-decoration: none; | |
} | |
.context__item:after { | |
content: "*"; | |
font: 11px/1 Verdana, sans-serif; | |
position: relative; | |
bottom: 1ex; | |
color: rgba(0,0,0,0.5) | |
} | |
.context__content { | |
float: right; | |
clear: right; | |
width: 5em; | |
margin: 0 -6em 1em 1em; | |
box-shadow: 0 0 0 1px rgba(0,0,0,0.2); | |
} | |
.context:hover > .context__item:not(:hover), | |
.context__item:hover + .context__content, | |
.context__content:target { | |
background: yellow; | |
} | |
.context__item::-webkit-details-marker { | |
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
<div class="a"> | |
<div class="b"> | |
<p> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | |
tempor | |
<!-- BTW, I wanted to use `details > summary` here, | |
but with no luck, see | |
http://www.mail-archive.com/[email protected]/msg26129.html | |
--> | |
<span class="context" | |
><a class="context__item" href="#incididunt">incididunt</a | |
><span class="context__content" id="incididunt"> | |
Something here | |
</span | |
></span> | |
ut | |
<span class="context" | |
><a class="context__item" href="#labore">labore</a | |
><span class="context__content" id="labore"> | |
Another thing here | |
</span | |
></span> | |
et dolore magna aliqua. Ut enim ad minim veniam, | |
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo | |
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | |
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non | |
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</p> | |
</div> | |
</div> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment