122 CSS Today and Tomorrow — From Style Sheet to Responsive Design System

The Technologies That Built the Web

CSS could be a mystery at first.

HTML was relatively easy to understand.

A heading was a heading.

A paragraph was a paragraph.

An image was an image.

Then CSS arrived with selectors, classes, IDs, inheritance, specificity, margins, padding, positioning, and the mysterious cascade.

Why did one rule work while another apparently did nothing?

Why did changing one property affect something somewhere else?

Why was that element three pixels away from where we thought it should be?

And why did the page look different in another browser?

For developers who learned the web through HTML, CSS required a different way of thinking.

But today CSS is not an optional decoration layer.

It is one of the fundamental technologies of the modern web.

CSS Has Become Much More Capable

Early CSS concentrated heavily on presentation.

Fonts.

Colors.

Margins.

Borders.

Backgrounds.

Those capabilities remain important, but modern CSS does far more.

It controls sophisticated layouts.

It adapts designs to available space.

It responds to user preferences.

It manages typography.

It creates animations and transitions.

It performs calculations.

It defines reusable values.

It can react to characteristics of both the viewport and individual containers.

CSS has evolved from a style sheet into something closer to a responsive design system.

The Cascade Is Still at the Center

Despite all the new capabilities, the central idea remains the cascade.

Multiple CSS rules can apply to the same element.

The browser determines which declarations take effect according to factors including origin, importance, specificity, scope, and source order.

This is powerful because styles can build upon one another.

It can also be confusing.

Many CSS mysteries begin with a simple question:

Which rule is actually winning?

Browser Developer Tools Changed CSS Development

Modern browser developer tools make answering that question dramatically easier than it once was.

A developer can inspect an element and see the rules affecting it.

Overridden declarations can be identified.

Values can be changed temporarily.

Margins and padding can be visualized.

Grid and Flexbox layouts can be inspected.

Media queries can be tested.

Different screen sizes can be simulated.

What once required repeated editing, saving, uploading, and reloading can often be explored directly inside the browser.

The Box Model Still Matters

Modern CSS may be sophisticated, but one of its oldest concepts remains essential.

Every element can still be understood through the box model:

Understanding those four layers explains an enormous number of layout questions.

Modern CSS also gives us tools such as box-sizing that make dimensions easier to reason about.

CSS has grown, but the fundamentals have not disappeared.

Pixels Still Have a Place

Pixels are sometimes treated as though modern CSS has made them obsolete.

It has not.

Pixels remain useful for borders, fine details, certain dimensions, and situations where a specific visual size makes sense.

The change is that we no longer need to think of the entire webpage as a fixed collection of pixels.

Modern CSS gives us much more flexible units.

em and rem

The em unit is relative to font sizing in its context.

The rem unit is relative to the root element's font size.

This makes rem particularly useful for consistent, scalable typography and spacing.

If a visitor increases their preferred text size, a design based thoughtfully on relative units can respond more naturally.

That is important for accessibility.

Why rem Can Be So Useful

Suppose the root font size is 16 pixels.

Then:

1rem = 16px

1.5rem = 24px

2rem = 32px

But the deeper value is not the arithmetic.

The value is the relationship.

Typography and spacing can be built around a common scale rather than isolated fixed measurements.

The Viewport Units

CSS also provides units related to the size of the viewport.

Values such as vw and vh allow dimensions to relate to the width or height of the browser's viewing area.

These units can be useful for responsive design.

But purely viewport-based sizing can also become too large or too small.

Modern CSS provides a particularly elegant solution.

clamp()

The clamp() function allows a value to have three parts:

minimum → preferred flexible value → maximum

Conceptually, we can say:

“Let this value grow with the available space, but never smaller than this and never larger than that.”

This is extremely useful for responsive typography.

A heading can grow smoothly between phone and desktop sizes without requiring numerous breakpoints.

Fluid Typography

Traditional responsive design often changed font sizes at particular breakpoints.

A heading might be one size on a phone and suddenly jump to another size on a larger screen.

Modern CSS can create a smoother relationship.

Typography can scale fluidly as the available space changes.

Functions such as clamp() allow us to establish sensible limits while letting the browser calculate the values between them.

This is a significant change in design philosophy.

Instead of specifying every possible size, we can describe the rules within which the browser should adapt.

CSS Is Becoming More Declarative

This idea reaches far beyond typography.

Modern CSS increasingly allows developers to describe what they want rather than manually calculating exactly how to produce it.

We can say:

Distribute these items evenly.

Center these elements.

Create as many columns as will comfortably fit.

Allow this value to grow within limits.

Rearrange this layout when space becomes limited.

The browser performs much of the calculation.

Flexbox

Flexbox has become one of the most useful everyday CSS layout tools.

It works particularly well when arranging items primarily along one dimension—a row or a column.

A navigation bar is a natural example.

Flexbox can control alignment, spacing, wrapping, order, and how items grow or shrink.

Tasks that once required floats, complicated margins, or table structures can often be expressed directly.

Grid

CSS Grid provides true two-dimensional layout.

Rows and columns can be defined together.

Elements can span multiple tracks.

Areas can be named.

Layouts can adapt according to available space.

Grid gives CSS the page-layout capability web designers had wanted almost from the beginning.

Flexbox or Grid?

This does not need to be a competition.

A useful rule of thumb is:

Flexbox is excellent for arranging things in a row or column.

Grid is excellent when rows and columns need to work together.

And they can be combined.

A page might use Grid for its overall structure and Flexbox inside individual components.

Use whichever tool most naturally describes the layout.

Responsive Design Without Endless Breakpoints

Early responsive designs often accumulated many media queries.

At this width, change this.

At another width, change that.

At another width, change something else.

Media queries remain extremely useful, but modern CSS can often reduce how many are necessary.

Grid, Flexbox, flexible units, min(), max(), clamp(), and other features can allow layouts to adapt naturally.

The browser can solve more of the layout problem itself.

Media Queries Are Still Important

Media queries are not disappearing.

They remain valuable when a design genuinely needs to change according to the viewing environment.

A navigation system might need a different arrangement on a narrow screen.

A multi-column page might need to become a single column.

Large decorative elements might be removed when space becomes limited.

The key is not to eliminate breakpoints.

It is to use them because the design needs them rather than because every possible screen width needs its own instructions.

Container Queries

One of the most important newer ideas in CSS is the container query.

Traditional media queries usually respond to the viewport.

But reusable components create another problem.

What if the screen is wide, but the component itself is sitting inside a narrow sidebar?

What if the same component appears elsewhere in a wide content area?

The component does not necessarily care how wide the screen is.

It cares how much space it has.

Components Can Respond to Their Own Space

Container queries allow styles to respond to characteristics of a containing element.

A card might display an image beside its text when it has enough room.

The same card could place the image above the text when its container becomes narrow.

The decision can happen independently of the overall screen size.

This is a major step toward truly reusable responsive components.

Responsive Design Moves Inward

The first major responsive-design revolution asked:

“How wide is the screen?”

Container queries allow us to ask:

“How much space does this particular component have?”

That may prove to be just as important.

Custom Properties — CSS Variables

CSS custom properties allow reusable values to be defined.

A site can establish values for colors, spacing, typography, borders, and other design choices.

Instead of repeating the same value throughout a style sheet, we can give it a meaningful name.

This makes CSS easier to understand and maintain.

From Style Sheet to Design System

Custom properties can represent more than convenient shortcuts.

They can express a site's visual system.

A website might define:

Individual components then use those shared values.

A redesign can sometimes be accomplished by changing a relatively small collection of variables.

Dark Mode

CSS can also respond to the visitor's preferred color scheme.

A site can provide a light appearance and a dark appearance while allowing the operating system or browser preference to influence which one is used.

This is another example of the web recognizing that the website author is not the only participant in presentation.

The visitor has preferences too.

Reduced Motion

Animation can improve an interface.

It can also create problems for people who are sensitive to motion.

Modern CSS can respond when a visitor has indicated a preference for reduced motion.

The website can reduce or eliminate unnecessary animations.

This is a powerful accessibility principle:

The design can adapt not only to the device, but to the person.

CSS and Accessibility Are Closely Connected

CSS affects readability, contrast, spacing, focus visibility, zooming, text enlargement, motion, layout, and many other aspects of accessibility.

A beautiful design that becomes unusable when text is enlarged is not a successful design.

A button whose focus outline has been removed may look cleaner to a mouse user while becoming difficult to locate for someone navigating with a keyboard.

Accessibility should not be something applied after the design.

It should be part of the design system.

The User Should Be Allowed to Change Things

This can require a change in thinking.

Traditional graphic design often seeks precise control.

Web design cannot assume that level of control.

A visitor may enlarge the text.

They may zoom the page.

They may use a narrow window.

They may prefer dark mode.

They may disable animation.

They may use a screen reader.

They may navigate without a mouse.

Modern CSS works best when it embraces that flexibility.

Modern Selectors

CSS selectors have also become much more powerful.

Developers have long been able to select elements according to type, class, ID, attributes, and relationships.

Newer selectors make more sophisticated relationships possible.

One particularly interesting example is :has().

:has() Changes the Direction

Traditionally, CSS could easily style an element according to where that element appeared.

But styling a parent according to what it contained was much more difficult.

The :has() selector changes that.

Conceptually, CSS can now express ideas such as:

“Style this element differently if it contains something matching this condition.”

Some interface behaviors that once required JavaScript can now be handled directly through CSS.

CSS Continues Taking Jobs From JavaScript

This is an interesting trend.

JavaScript is extraordinarily powerful, but not every visual behavior needs a programming language.

Modern CSS can handle:

If CSS can perform the task reliably and accessibly, using CSS can mean less code and fewer opportunities for errors.

CSS Nesting

CSS has also gained native nesting capabilities.

Developers using preprocessors such as Sass became accustomed to organizing related rules inside one another.

Modern CSS is increasingly able to provide similar organizational capabilities directly.

Another task that once required an additional development layer is moving into the web platform itself.

The Platform Keeps Absorbing Good Ideas

This is a recurring pattern.

Developers create workarounds, libraries, preprocessors, or frameworks to solve missing capabilities.

The successful ideas demonstrate what developers need.

Standards evolve.

Browsers implement native solutions.

Eventually an additional layer may no longer be necessary for that particular task.

The web learns from its own ecosystem.

Do We Still Need Sass?

CSS preprocessors such as Sass were extremely valuable because they added features CSS once lacked, including variables, nesting, reusable patterns, and other development conveniences.

They remain useful in many projects.

But native CSS has gained several capabilities that once required preprocessors.

For a new project, it is reasonable to ask the same question we asked about jQuery:

What problem does this additional layer solve for us?

If native CSS already solves the problem cleanly, another tool may not be necessary.

Vendor Prefixes Today

Vendor prefixes such as -webkit- and -moz- once appeared throughout cutting-edge style sheets.

They allowed browsers to experiment with developing features.

Today they are much less central to everyday CSS development.

Modern standards processes and browser coordination have improved.

Some prefixed properties remain relevant in particular situations, especially for historical compatibility or certain browser-specific capabilities.

But developers generally should not automatically add every imaginable prefix to every property.

Start with the standard.

Check browser support when necessary.

Add compatibility measures when there is a real reason.

We Wrote It to the Standard

This represents enormous progress from the browser-war era.

Developers once spent significant time maintaining separate rules for different browsers.

Today the goal is much simpler:

Write it to the standard. Now it is the browser's turn.

Testing still matters.

Compatibility still matters.

But the standard—not a particular browser—is increasingly the common target.

Logical Properties

CSS is also becoming better suited to a global web.

Traditional properties often assume concepts such as left and right.

But not every language is written in the same direction.

Logical properties can describe layout according to the flow of the document rather than fixed physical directions.

This makes designs more adaptable to different writing systems and international content.

Modern CSS Understands Context

Step back and look at what is happening.

CSS can respond to:

CSS is no longer simply describing fixed appearance.

It is describing how presentation should adapt to context.

Intrinsic Design

This leads toward an increasingly important philosophy sometimes described as intrinsic design.

Instead of specifying every possible layout at every possible screen size, developers establish rules and constraints.

Content and available space help determine the result.

A grid can create as many columns as fit.

A heading can grow within limits.

A component can change according to its container.

The browser becomes an active participant in solving the layout.

Tell the Browser the Rules

This may be one of the biggest changes in modern CSS.

Older CSS often felt like:

“Put this exactly here.”

Modern CSS increasingly feels like:

“Here are the rules. Arrange this intelligently within them.”

That approach fits the web much better because the developer cannot know every device, screen, font, preference, and circumstance in advance.

CSS and Performance

CSS is generally efficient, but design decisions still affect performance.

Very large style sheets can contain unnecessary rules.

Complex visual effects can require additional rendering work.

Animations should be used thoughtfully.

External fonts can affect loading performance.

Unused frameworks can add considerable CSS that a website never needs.

As always, simpler can be better.

Do We Need a Framework?

Bootstrap and other CSS frameworks solve genuine problems.

They can provide consistent grids, components, spacing systems, and responsive behaviors.

They can be particularly useful when large teams need to build interfaces consistently and quickly.

But a custom informational website may not need thousands of predefined rules.

A carefully designed style sheet may be smaller, easier to understand, and better suited to the site's identity.

The right tool depends upon the job.

CSS Architecture Matters

As style sheets grow, organization becomes increasingly important.

Consistent naming helps.

Reusable variables help.

Logical grouping helps.

Avoiding unnecessary specificity helps.

Understanding inheritance helps.

CSS becomes much easier to maintain when developers think of it as a system rather than a collection of individual fixes.

Avoid Fighting the Cascade

When CSS becomes difficult, the instinct can be to add increasingly specific selectors or use !important repeatedly until the desired style wins.

Sometimes !important has a legitimate purpose.

But excessive use can turn the style sheet into an escalating battle.

Understanding why a rule is winning is usually better than simply overpowering it.

The cascade is not a bug in CSS.

The cascade is CSS.

Artificial Intelligence Meets CSS

Artificial intelligence can make CSS development substantially easier.

A developer can describe a desired layout and ask AI to suggest Grid or Flexbox rules.

AI can explain why a selector is not working.

It can identify redundant styles.

It can convert older float layouts to modern CSS.

It can suggest responsive typography.

It can help analyze accessibility concerns.

It can explain unfamiliar modern properties.

It can help modernize style sheets that have evolved over many years.

AI Can Help Us Learn CSS

This may be particularly important because CSS has always contained an experimental aspect.

Developers try a value.

They look at the result.

They adjust it.

They inspect another screen size.

They discover an interaction they did not expect.

AI can now participate in that learning process.

Instead of merely asking “What value should I use?” we can ask:

“Why did the browser do that?”

That is a much more valuable question.

AI Will Generate a Lot of CSS

Future website-building systems will undoubtedly generate increasing amounts of CSS automatically.

A designer may describe a visual system in ordinary language.

AI may create the layout, responsive rules, typography, color variables, and component styles.

That does not make understanding CSS irrelevant.

It may make understanding CSS more important.

Someone still needs to recognize whether the generated result is maintainable, accessible, responsive, efficient, and appropriate.

Generated CSS Can Be Bad CSS

AI can easily generate code that appears to work.

But working at one screen width is not enough.

The CSS might contain unnecessary rules.

It might use fixed dimensions where flexible ones would be better.

It might introduce excessive specificity.

It might create poor contrast.

It might break when text is enlarged.

It might solve a simple problem with unnecessary complexity.

AI does not eliminate the need for judgment.

Understanding the Goal Matters More Than Memorizing Properties

As AI becomes better at generating syntax, memorizing every CSS property may become less important.

Understanding design principles may become more important.

Should this value be fixed or flexible?

Should this layout use Grid or Flexbox?

Should this respond to the viewport or the container?

What happens when the visitor enlarges the text?

Does the reading order still make sense?

Can the browser already solve this without JavaScript?

Those are architectural questions.

CSS Tomorrow

The direction of CSS is becoming increasingly clear.

CSS will become more adaptive.

More component-aware.

More responsive to user preferences.

More capable of expressing relationships.

More capable of performing calculations.

And increasingly able to solve interface problems that once required JavaScript or additional libraries.

At the same time, browsers and standards will continue absorbing useful ideas that have been proven by frameworks and preprocessors.

The Browser Becomes the Layout Engine We Always Wanted

During the table-layout era, web developers spent enormous effort forcing browsers to create layouts.

Today we increasingly describe our intentions and allow the browser to determine the details.

That is a fundamental shift.

We no longer need to place a transparent GIF somewhere to create twenty pixels of space.

We can describe relationships, constraints, preferred sizes, minimums, maximums, grids, flexible regions, and responsive behavior.

The browser does the math.

From Mystery to Necessity

CSS may have seemed mysterious when it first arrived.

HTML was visible and direct.

CSS introduced another layer and another set of rules to understand.

But that separation became one of the web's greatest strengths.

HTML could concentrate on meaning.

CSS could concentrate on presentation.

JavaScript could concentrate on behavior.

Each layer could evolve.

Each could become more capable.

And each could do the job it was best suited to perform.

The Technology Can Become Invisible Without Becoming Unimportant

A visitor does not normally think about Grid.

They do not think about rem.

They do not think about clamp().

They do not think about media queries or container queries.

They simply notice that the site works.

The text is readable.

The navigation fits.

The page looks good on their phone.

The design responds when they enlarge the text.

The content remains comfortable to use.

Good CSS disappears into the experience.

The technology can become invisible without becoming unimportant.

Use the Simplest Tool That Solves the Problem

The same principle we discovered with JavaScript applies beautifully to CSS.

Use HTML for structure and meaning.

Use CSS for presentation and layout.

Use JavaScript when actual programming behavior is needed.

Use Grid when Grid describes the layout naturally.

Use Flexbox when Flexbox fits the problem.

Use a media query when the design needs a breakpoint.

Use a container query when the component needs to understand its own space.

Use relative units when flexibility matters.

Use pixels when pixels make sense.

Technology should serve the project. The project should not exist to serve the technology.

Next: The History of HTML

We have now explored JavaScript and CSS.

But both of them depend upon something even more fundamental.

Before the browser can style a heading, there must be a heading.

Before JavaScript can find a form, there must be a form.

Before CSS can arrange the page, the page needs structure.

That brings us back to the technology at the beginning of the World Wide Web:

HTML — HyperText Markup Language.

Next in The Technologies That Built the Web, we will return to CERN and Tim Berners-Lee, examine the first HTML elements, follow HTML through the browser wars, tables and frames, HTML 4 and XHTML, and eventually reach HTML5 and the modern semantic web.

It may be the oldest technology in our browser trio.

But after more than three decades, HTML remains the structure upon which the web is built.

Home
Brad Zehr | Zehr.net | brad@zehr.net

About Services Why A Site Site Ideas Topics Podcast Help Contacts

Topics, Podcast & Images on this site are AI Assisted.

Search Contact Home