Last active
July 2, 2017 06:35
-
-
Save dchowitz/5105bf8694b1f4c3732af059ad97324e to your computer and use it in GitHub Desktop.
Revisions
-
dchowitz renamed this gist
Jul 2, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dchowitz revised this gist
Jul 2, 2017 . 3 changed files with 3 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ <div class="rating"> <input type="radio" id="rating1" name="rating"/> <label for="rating1">star1</label> <input type="radio" id="rating2" name="rating"/> 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ Rating Input Elaboration ------------------------ Fiddling around with getting a rating input consisting of checkboxes rendered as stars to work with CSS only. A [Pen](https://codepen.io/dchowitz/pen/yXKabo) by [Denny Christochowitz](http://codepen.io/dchowitz) on [CodePen](http://codepen.io/). 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 charactersOriginal file line number Diff line number Diff line change @@ -11,19 +11,13 @@ $new: gold; .rating > input { display: none; } .rating > label { font-size: 0; } .rating > label:before { font-size: 2rem; // wouldn't work with em, since em is always relative to the parent content: '★'; } -
dchowitz created this gist
Jul 2, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <div class="rating" data="foo"> <input type="radio" id="rating1" name="rating"/> <label for="rating1">star1</label> <input type="radio" id="rating2" name="rating"/> <label for="rating2">star2</label> <input type="radio" id="rating3" name="rating"/> <label for="rating3">star3</label> <input type="radio" id="rating4" name="rating"/> <label for="rating4">star4</label> </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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ Rating Input Elaboration ------------------------ Fiddling around with getting a rating input consisting of five checkboxes rendered as stars to work. A [Pen](https://codepen.io/dchowitz/pen/yXKabo) by [Denny Christochowitz](http://codepen.io/dchowitz) on [CodePen](http://codepen.io/). [License](https://codepen.io/dchowitz/pen/yXKabo/license). 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ $active: orange; $new: gold; .rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; color: grey; } .rating > input { display: none; } /* .rating > label { overflow: hidden; width: 1em; white-space: nowrap; }*/ .rating > label { font-size: 0; } .rating > label:before { font-size: 2rem; // doesn't work with em content: '★'; } input:checked ~ label { color: $active; } .rating:hover > label { color: grey; } .rating:hover > label:hover, .rating:hover > label:hover ~ label { color: $new; }