Presenting about the 3 pillars of CSS architecture at Front in Sampa 2024 gave me the opportunity to read a lot about CSS from a theoretical point of view, which I feel gave me a more mature, holistic and strategic view of CSS development at scale.
On this tour I discovered points of view about CSS that, in addition to rekindling my curiosity, left me excited to make new decisions with these new views of the world.
?
Cyclomatic Complexity: Logic in CSS by Harry Roberts
Cyclomatic complexity is a metric of a program's complexity - each flow control and each output increases the complexity of a method, class or application.
In CSS, complexity can mean slow, poorly reusable and overly specific selectors.
div.sidebar .login-box a.btn span {} /* Pode ser lido como IF (inside .btn) AND IF (on a) AND IF (inside .login-box) AND IF (inside .sidebar) AND IF (on div) */
?
"Think of your selectors as mini programs"
?
Link to the article on the CSSWizardry blog, in English
?
?
Conditional CSS by Ahmad Shadeed
Still about the value of seeing CSS as a language with logical operations, not just talking about media queries that make logical evaluations to make code available according to context conditions, but every interactive state, the presence or not of a next selector, from a selector index, or from the presence of a specific child (with :has).
It is an article that is extremely current with the new properties and the paradigm shift caused by :has, container queries and the already existing but not so explored support queries.
?
Link to the article on Ahmad Shadeed's blog, in English
?
?
The CSS Cascade by Amelia Wattenberger
Cascade Stylesheets, and yet it is very common to see CSS errors that involve the way and order in which the CSS is written. In this beautiful blog post by Amelia Wattenberger, in a simple and visual way, she demonstrates how the waterfall works and provides insights into how to think about your CSS with it in mind.
?
Link to the article on Amelia Wattenberger's blog, in English
?
?
A Brief History of CSS-in-JS: How We Got Here and Where We're Going by Dan Ward
The more I needed to use CSS-in-JS, the more its negative points bothered me, such as bundle size, runtime changes and a confusing reuse versus co-location architecture. With CSS variables it becomes even more obsolete to prefer arrow function versus injecting variables via styles - it's much simpler and CSS handles this type of scope well.
It is in this article that we understand why and how it exists, with incredible links mentioned throughout.
?
Link to the article on medium, in English
?
?
CSS and the critical path by Stoyan Stefanov
CSS is the biggest offender in slow web loading, unused and excessive CSS, selectors and operations that in interaction affect more nodes than they should, even complex and slow selectors that would require less overhead and more architecture.
In this article you will understand how the browser works in loading, compiling and prioritizing this critical asset and how to make the path to it less painful for the end user.
?
Link to the article on Stoyan Stefanov's blog, in English
After reading, watch this video by Harry Roberts about CSS performance on Frontend United
?
?
Responsive Web Design
Ethan Marcotte coined the term "responsiveness" based on architectural assemblies that in a certain way responded to the occupation of their space, this glimpse inspired by John Alsopp's text in the year 200 that called for a freer Web that dictated fewer rules to users in a world with a growing number of devices has changed the way we write interfaces and will change the way you see them too.
?
Link to the article on the A List Apart blog, in English
After reading, watch this video by Jen Simmons with a modern look at responsiveness - intrinsic layouts
?
?
To close
The future of loading CSS by Jake Archibald
I met Jake watching HTTP 203 on the Google channel and have been following his blog ever since. In this article he explores the possibility of including links in the folds of
to progressively load the styles of what is below the "fold".Didn't know it was possible? Yeah, TIL too!
?
Link to the article on Jake's blog, in English
?
After reading, watch the HTTP 203 show on the Chrome for Developers channel, I learn a lot from Jake and his guests
The above is the detailed content of Articles about CSS that blew my head in 4. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CSS blocks page rendering because browsers view inline and external CSS as key resources by default, especially with imported stylesheets, header large amounts of inline CSS, and unoptimized media query styles. 1. Extract critical CSS and embed it into HTML; 2. Delay loading non-critical CSS through JavaScript; 3. Use media attributes to optimize loading such as print styles; 4. Compress and merge CSS to reduce requests. It is recommended to use tools to extract key CSS, combine rel="preload" asynchronous loading, and use media delayed loading reasonably to avoid excessive splitting and complex script control.

ThebestapproachforCSSdependsontheproject'sspecificneeds.Forlargerprojects,externalCSSisbetterduetomaintainabilityandreusability;forsmallerprojectsorsingle-pageapplications,internalCSSmightbemoresuitable.It'scrucialtobalanceprojectsize,performanceneed

No,CSSdoesnothavetobeinlowercase.However,usinglowercaseisrecommendedfor:1)Consistencyandreadability,2)Avoidingerrorsinrelatedtechnologies,3)Potentialperformancebenefits,and4)Improvedcollaborationwithinteams.

CSSismostlycase-insensitive,butURLsandfontfamilynamesarecase-sensitive.1)Propertiesandvalueslikecolor:red;arenotcase-sensitive.2)URLsmustmatchtheserver'scase,e.g.,/images/Logo.png.3)Fontfamilynameslike'OpenSans'mustbeexact.

Autoprefixer is a tool that automatically adds vendor prefixes to CSS attributes based on the target browser scope. 1. It solves the problem of manually maintaining prefixes with errors; 2. Work through the PostCSS plug-in form, parse CSS, analyze attributes that need to be prefixed, and generate code according to configuration; 3. The usage steps include installing plug-ins, setting browserslist, and enabling them in the build process; 4. Notes include not manually adding prefixes, keeping configuration updates, prefixes not all attributes, and it is recommended to use them with the preprocessor.

CSScounterscanautomaticallynumbersectionsandlists.1)Usecounter-resettoinitialize,counter-incrementtoincrease,andcounter()orcounters()todisplayvalues.2)CombinewithJavaScriptfordynamiccontenttoensureaccurateupdates.

In CSS, selector and attribute names are case-sensitive, while values, named colors, URLs, and custom attributes are case-sensitive. 1. The selector and attribute names are case-insensitive, such as background-color and background-Color are the same. 2. The hexadecimal color in the value is case-sensitive, but the named color is case-sensitive, such as red and Red is invalid. 3. URLs are case sensitive and may cause file loading problems. 4. Custom properties (variables) are case sensitive, and you need to pay attention to the consistency of case when using them.

Theconic-gradient()functioninCSScreatescirculargradientsthatrotatecolorstopsaroundacentralpoint.1.Itisidealforpiecharts,progressindicators,colorwheels,anddecorativebackgrounds.2.Itworksbydefiningcolorstopsatspecificangles,optionallystartingfromadefin
