Hasty Treat - CSS Nesting 1

Hasty Treat - CSS Nesting 1

In this Hasty Treat, Scott and Wes talk about CSS nesting — what it is, when to use it, and why. Prismic - Sponsor Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax. Sentry - Sponsor If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up. Show Notes 04:22 - What is it? https://drafts.csswg.org/css-nesting-1/#nest-prefixed https://twitter.com/argyleink/status/1371874777548267520 06:02 - Why nest? Easier to read Easier to write Prevents refactoring errors, allows for dry-er code. No more typing a parent div 100 times, with a possibility of screwing it up. 08:13 - When to use nesting Nesting is often overused Only nest what you would have written un-nested with a short hand (e.g. don’t nest just for the sake of it) .container .item {} .container .item a {} Use it for scoping 10:06 - Nesting prefixes In order to nest CSS, you must first start it with a nesting selector .tweet { & > p { } &.media-included { color: green; } & + .tweet { } // sibling & p { } // descentang } Component-based — tweet, card, company, Link article{ color: blue; & { color: red; } } and must be the first child of a compound selector 12:44 - @nest rule / media queries Mostly just a visual way to show nested .foo { display: grid; @media(orientation: landscape) { & { grid-auto-flow: column; } } } .foo { display: grid; @media (orientation: landscape) { & { grid-auto-flow: column; } @media (min-inline-size > 1024px) { & { max-inline-size: 1024px; } } } } /* equivalent to .foo { display: grid; } @media (orientation: landscape) { .foo { grid-auto-flow: column; } } @media (orientation: landscape) and (min-inline-size > 1024px) { .foo { max-inline-size: 1024px; } } */ 16:30 - How to use nesting today Literally any CSS preprocessor PostCSS to use spec Links Syntax 274: How does stuff get added to CSS? Adam Argyle answers! Sass PostCSS CSS Variables 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

Jaksot(998)

What's New in CSS? Variables, Scoping, New Selectors and Color Functions

What's New in CSS? Variables, Scoping, New Selectors and Color Functions

Wes and Scott talk about the future of CSS - what is new and what should we expect to be coming in the near future? Bug Replay - Sponsor You need to try out Bug Replay for recording and re-playing br...

29 Marras 201758min

Fitness, Nutrition, and Losing Weight 💪🏻

Fitness, Nutrition, and Losing Weight 💪🏻

Wes and Scott talk about their fitness journey and how it relates to being a web developer in terms of energy, focus and mental clarity. Get Fit with Dev Lifts — Show Sponsor Dev Lifts - Thad and JC ...

22 Marras 20171h 10min

How to get into Speaking At Conferences

How to get into Speaking At Conferences

Wes talks to Scott about speaking at conferences. What are the benefits of speaking? How do you apply? What talk should you give? What makes a good conference talk? Freshbooks is the best! Freshbooks...

15 Marras 20171h 7min

All About CSS Grid

All About CSS Grid

It's a long awaited CSS Grid show! How does it work? When do you use it? What's the difference between Grid and Flexbox? Sponsor Save A Bro is selling absolutely hilarious mustache t-shirts for $18...

8 Marras 20171h 4min

22 Buzz Words Explained — Mutations, Pure Functions , Serverless, Hoisting, MVC + More

22 Buzz Words Explained — Mutations, Pure Functions , Serverless, Hoisting, MVC + More

Buzz Words! WTF Do they mean?! Do They Mean Things?? Let's Find Out! Sponsor Freshbooks - Get 30 days free. Make sure to enter SYNTAX into the "How did you hear about us" section. The Buzz Words ...

1 Marras 20171h 4min

Tasty Treats — Rems VS Ems, Remote Work, Making Money, Getting good at Design + more! 🍬

Tasty Treats — Rems VS Ems, Remote Work, Making Money, Getting good at Design + more! 🍬

Show Notes Q: Rems vs Ems vs Pixels? What do you use? Q: What activity, that isn't developer related, benefits you most as a developer? Becoming a Supple Leopard Q: Is a hot dog a sandwich? 🌭 Q ...

18 Loka 20171h 10min

Advice for New Developers, Imposter Syndrome and Interviewing at Google

Advice for New Developers, Imposter Syndrome and Interviewing at Google

Scott and Wes dish out some tasty advice to developers who are new to web development. How do you get better? How do you deal with imposter syndrome? Sponsor Freshbooks - Get 30 days free. Make sur...

11 Loka 20171h 11min

Our Stacks Explained 🖥️ 💪

Our Stacks Explained 🖥️ 💪

Scott and Wes detail their current stacks that run their training platforms. From front end code linting to the server side and databases. Sponsor Intro to The Serverless Framework by Loren Stewart. ...

4 Loka 20171h 19min

Suosittua kategoriassa Politiikka ja uutiset

uutiscast
aikalisa
ootsa-kuullut-tasta-2
politiikan-puskaradio
rss-ootsa-kuullut-tasta
tervo-halme
viisupodi
rss-vaalirankkurit-podcast
rss-podme-livebox
rss-pinnalla
rss-girls-finish-f1rst
aihe
the-ulkopolitist
otetaan-yhdet
rss-asiastudio
rss-ulkopoditiikkaa
et-sa-noin-voi-sanoo-esittaa
rss-kaikki-uusiksi
rss-raha-talous-ja-politiikka
rss-vain-talouselamaa