DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Programmatic Brand Extraction: Pulling Logos, Colors, and Assets from Any URL
  • The Death of the CSS Selector: Architecting Resilient, AI-Powered Web Scrapers
  • A Guide to Parallax and Scroll-Based Animations
  • Building a Card Layout Using CSS Subgrid

Trending

  • Why Round-Robin Won't Save You: Load Balancing Challenges in Data Streaming Services With Heterogeneous Traffic
  • Good Data, Bad Metric: A Mutation Testing Pattern for Analytics Engineering
  • Building AI-Powered Java Applications With Jakarta EE and LangChain4j
  • Rust-Native Alternatives to Spark SQL and DataFrame Workloads
  1. DZone
  2. Coding
  3. Languages
  4. What's Coming for CSS: Compatibility and Control

What's Coming for CSS: Compatibility and Control

The W3C CSS working group continues to tackle two of web development's most common problems—compatibility and control—with high-level standards.

By 
Rodrigo Kyle Mehren user avatar
Rodrigo Kyle Mehren
·
Apr. 03, 16 · News
Likes (8)
Comment
Save
Tweet
Share
11.4K Views

Join the DZone community and get the full member experience.

Join For Free

Core CSS—as distinct from frameworks—is set to become more relevant, not less, to developer activities, as new capabilities are proposed in response to common, overlapping problems: cross-browser compatibility and layout control. 

Pain points have arisen here frequently for web developers—some might even say it's bred into the discipline now. Seeking polyfills, hacks, clever manipulations of the DOM, and plugins to do the work of creating a single and predictable experience is anticipatable.

For instance, the allure of Angular.js, jQuery, and other JavaScript variants is that they focus on behind-the-scenes work in order to deliver one API to the developer. However, using JS can create situations where the rendering engine wastes work because of JS's inopportune place in the pipeline. 

Bootstrap, Foundation, and others are an attempt to approach the problem from the other side: using highly prescriptive conventions, they attempt to capitalize on known behavior to create uniformity.

With those problems in mind, the engineers of the W3C have some intriguing solutions that are coming to CSS in the future. 

Houdini

It's the name of a new W3C group creating tools developers can use to create code that takes part in the styling and layout process of a browser’s rendering engine, via a new set of APIs.

This means developers can do more to influence the internal work done by the rendering engine, as opposed to simply giving it a style sheet and guessing how it will interpret your intent.

CSS Grids

In the future, web designers will have a new layout manager, the Grid Layout Manager. It combines speed, responsive design, and an adaptable grid, coded in a way similar to a table. The new approach does (some of) what a framework such as Bootstrap or Foundation does, but the new grid layout manager gives web designers more control natively—it splits up the screen and defines the relationship of elements to each other, while also adapting to form factor and orientation "without [designers] needing to alter the semantic nature of their content."

CSS Snap Points

...given the imprecise nature of ... inputs like touch panning and mousewheel scrolling, it is difficult for web developers...[to create] the effect of paging through content. For instance, it is easy for a user to land at an awkward scroll offset which leaves a page partially on-screen when panning.

- W3C 

Here's an example of how this would be coded, from W3c:

img {
    /* Specifies that the center of each photo 
       should align with the center of the scroll 
       container in the X axis when snapping */
    scroll-snap-align: center none;

}
.photoGallery {
    width: 500px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    /* Requires that the scroll offset always be 
       at a valid snap position when the scrolling 
       operation completes. */
    scroll-snap-type: mandatory;
}
<div class="photoGallery">
    <img src="img1.jpg">
    <img src="img2.jpg">
    <img src="img3.jpg">
    <img src="img4.jpg">
    <img src="img5.jpg">
</div>

Which yields a paginated document, where red is the snap container, and yellow represents the "scroll-snap-align" axes of an <img>.

Snap positions and container


CSS Compatibility (chemical)

Opinions expressed by DZone contributors are their own.

Related

  • Programmatic Brand Extraction: Pulling Logos, Colors, and Assets from Any URL
  • The Death of the CSS Selector: Architecting Resilient, AI-Powered Web Scrapers
  • A Guide to Parallax and Scroll-Based Animations
  • Building a Card Layout Using CSS Subgrid

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook