meta_pixel
Tapesearch Logo
Log in
Syntax - Tasty Web Development Treats

Hasty Treat - Uses for CSS Variables

Syntax - Tasty Web Development Treats

Wes Bos

Tech News, Technology, News

4.9 • 1.2K Ratings

🗓️ 3 December 2018

⏱️ 26 minutes

🧾️ Download transcript

Summary

In this Hasty Treat, Scott and Wes talk about CSS variables, a.k.a CSS Custom Properties - why you might want to use them, why they’re better than various preprocessor’s variables, and pitfalls to watch out for and avoid. Kyle Prinsloo’s Freelancing & Beyond — Sponsor Kyle Prinsloo teaches you everything you need to know about freelancing, including how to quit your job, earn a side-income and start taking control of your life. Check it out at https://studywebdevelopment.com/freelancing and use the coupon code “syntax” at checkout to get 25% off. Show Notes 3:25 - What --example-name, represent custom properties called using var() Overwrite with a more specific style Use JavaScript to append .style.setPropert( How are they scoped? Just like normal CSS Can be set on :root {} Can be set on any element down 9:10 - Why Uses: Can make more sense if used semantically var(–accent) vs var(–yellow) Independent values for things that can’t be broken up: box-shadow: 2px 2px 2px 2px red transform: rotate(var(–rotate)) scale(2); Inline properties can be picked up by regular CSS (color, size, etc.) hey Themes that can easily be changed at runtime for entire app 19:15 - Calculations You can use them inside of calc() Animations 20:10 - Bummers Not super well supported just yet (IE 11) No good fallback other than manual fallback Syntax - Old Browsers, Fallbacks and Polyfills series Part 1 Part 2 Part 3 PostCSS Custom Properties Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Transcript

Click on a timestamp to play from that location

0:00.0

Monday, Monday, Monday,

0:02.0

Open wide Dev fans.

0:04.0

Get ready to stuff your face

0:06.0

with JavaScript, CSS, node modules, barbecue tips,

0:09.0

get workflows,

0:10.0

break dancing, soft skills, web development,

0:12.0

the hastiest, the craziest, the craziest development the hastiest the craziest the tastiest web development treats coming in hot here is

0:18.1

Wes Barracuda bars and Scott El Toro Loco Tolinsky.

0:26.0

Welcome to Syntex.

0:28.0

In this hasty Monday treat, we are going to be talking

0:32.0

all about CSS variables aka custom

0:35.4

properties in CSS why you might want to use them why they're better than your

0:40.2

CSS pre-processors variable system and some of the pitfalls that you could

0:45.3

run into while using them. My name is Scott Tolinsky at S Tolinsky at

0:50.4

all of the social medias and I am a full-stack web developer from Denver,

0:54.5

Colorado and with me is always is West Boss. Hey everybody hopefully you're

0:59.3

doing well on this Monday morning or afternoon or whenever you're listening to it? Yes or maybe

1:04.7

it's not even a Monday maybe you've time traveled. Maybe you're just listening to

1:09.2

it later I guess that's a more reasonable assumption. So this episode is sponsored by Kyle Prince Lou's freelancing

1:16.2

course, everything you need to know to master freelancing. And this thing is a bundle to take you to that next level into making

1:26.0

more money doing a better job and all around just being a better freelancer.

1:30.2

So with more about that course is Wes.

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Wes Bos, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Wes Bos and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2026.