CSS
Include Stylesheet #
<link rel="stylesheet" href="style.css">
System Font Defaults #
Shipping system fonts to GitHub.com
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
Using CSS Variables #
Browser support for CSS variables
:root {
--primary-color: #db0a5b;
}
.something {
color: var(--primary-color);
}
Dark Mode #
:root {
--text-color: #000;
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: #fff;
}
}
Hover Element Change Another #
<div class="hoverer">hover me</div>
<div class="hoveree">and I will appear</div>
.hoveree {
display: none;
}
.hoverer:hover + .hoveree {
display: block;
}
Quick Calendar with grids #
Setting up a calendar with HTML/CSS is so easy these days.
Make a container, put 28, 30, or 31 elements inside. Add two (2) lines of CSS:
display: grid;
grid-template-columns: repeat(7, 1fr);
Then tell calendar > day:first-child
to start at the appropriate spot in the grid with grid-column-start: n
You’re done. Style to taste.
Double Text Shadow #
text-shadow: rgba(10, 189, 240, 0.298039) 3px 3px 0px, rgba(254, 1, 1, 0.298039) -3px -3px 0px;
Stop iOS changing unicode characters to emoji #
[aria-checked="false"] > i::before {
content: "\2610\fe0e";
}
[aria-checked="true"] > i::before {
content: "\2611\fe0e";
}
Links #
- CSS accent-color
- Grid Garden - A game for learning CSS grid
- Flexbox Froggy - A game for learning CSS flexbox
- What The Flexbox?! — A simple 20 video course that will help you master CSS Flexbox
- ColorSpace - CSS Gradient Color Generator
- Relearn CSS layout: Every Layout
- Make “Pre” Text Wrap
- Glide CSS — A tiny component-first CSS framework for Sass
- PurgeCSS - Remove unused CSS
- NES.css - NES-style CSS Framework
- The future of CSS: Nesting Selectors – Bram.us
- CSS Nesting Module
- How to Create Neon Text With CSS | CSS-Tricks
- A Complete Guide to Custom Properties | CSS-Tricks
- OctoD/postcss-brexit: A post brexit plugin for post-css made for true British English programmers
- Grainy Gradients | CSS-Tricks
- Pico.css • Minimal CSS Framework for semantic HTML
- Light and dark mode in just 14 lines of CSS
- A responsive striped CSS gradient inspired by 80s VHS tapes
- CSS Grid Generator
- CSS HD Gradients
- The Flipping CSS Loaders Collection
- CSS Selectors Playground