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
| /** | |
| * Fluid background, fixed content | |
| */ | |
| header, section, footer { | |
| padding: 1em calc(50% - 350px); | |
| } | |
| footer { | |
| background: #333; |
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
| /** | |
| * Styling by sibling count: Color palette example | |
| */ | |
| /* Hide "color" 4 items or more */ | |
| .palette li:first-child:nth-last-child(n+4) .color-options a:after, | |
| .palette li:first-child:nth-last-child(n+4) ~ li .color-options a:after { | |
| content: 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
| /** | |
| * Taming table column widths | |
| */ | |
| body { background: #ddd } | |
| section { | |
| width: 500px; | |
| margin: 2em; | |
| background: white; |
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
| /** | |
| * Intrinsic sizing | |
| */ | |
| figure { | |
| max-width: 300px; | |
| max-width: min-content; | |
| margin: auto; | |
| } |
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
| /** | |
| * Interactive image comparison - with CSS resize | |
| */ | |
| .image-slider { | |
| position:relative; | |
| display: inline-block; | |
| } | |
| .image-slider > 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
| /** | |
| * Scrolling hints | |
| */ | |
| ul { | |
| display: inline-block; | |
| overflow: auto; | |
| width: 7.2em; | |
| height: 7em; | |
| border: 1px solid silver; |
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
| /** | |
| * De-emphasizing by blurring (AND dimming) | |
| */ | |
| main { | |
| transition: .6s; | |
| background: white; | |
| } | |
| main.de-emphasized { |
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
| /** | |
| * Native modal dialog (limited support) | |
| */ | |
| dialog::backdrop { | |
| background: rgba(0,0,0,.8) | |
| } |
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
| /** | |
| * Rudimetary overlay with box-shadow | |
| */ | |
| .lightbox { | |
| position: fixed; | |
| top: 50%; left: 50%; | |
| margin: -200px; | |
| box-shadow: 0 0 0 50vmax rgba(0,0,0,.8); | |
| } |
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
| /** | |
| * Toggle buttons | |
| */ | |
| input[type="checkbox"] { | |
| position: absolute; | |
| clip: rect(0,0,0,0); | |
| } | |
| input[type="checkbox"] + label { |