@stasgavrylov
Lead Frontend Engineer @ Rails Reactor
Slides:
https://slides.com/stasgavrylov/css
Over 50 (!!!) solutions
https://github.com/MicheleBertoli/css-in-js
const Button = styled.a` display: inline-block; border-radius: 3px; padding: 0.5rem 0; margin: 0.5rem 1rem; width: 11rem; background: transparent; color: white; border: 2px solid white; ${props => props.primary && css` background: white; color: palevioletred; `} `
CSS Custom Properties 2012-04-10 First Public Draft 2015-12-03 Candidate Recommendation
https://github.com/postcss/postcss-custom-properties
:root { --app-max-width: 600px; } #app { --main-color: midnightblue; padding: calc(50% - var(--app-max-width) / 2); background: linear-gradient( 90deg, var(--main-color) 0%, var(--dynamic-color, white) 100% ); }
:root { --tilted-gradient: linear-gradient( calc(var(--tilt-angle) * 1deg), black 0%, white 100% ); } .tilted { --tilt-angle: 45; background-image: var(--tilted-gradient); }
*, .withTiltedGradient { --tilted-gradient: linear-gradient( calc(var(--tilt-angle) * 1deg), black 0%, white 100% ); } .tilted { --tilt-angle: 45; background-image: var(--tilted-gradient); }
By Stas Gavrylov
A primer on using CSS Custom Properties in React apps