miercuri, 2 august 2017

Responsive Design Beyond the Media Query: A Deep Look At Container Queries

http://bit.do/dbL4V DBSchema secret sale page.
Media queries have become a part of the web developer's everyday toolkit. In the time since the iPhone first brought true web browsing to mobile devices, they have gone from obscure tool used for print to an absolute necessity. There's just one problem: While they work great for making responsive layouts, they're terrible for creating responsive components. Ideally, a truly reusable component should be able to function in multiple places in a layout at any one of a number of screen sizes and "just work", but with media queries this quickly results in multiplying complexity as you need new styles not only for every screen size but also every possible location in the layout. Enter element and container queries. The original idea of an "element query" was to allow you to target sizes for an element directly in css, so that you can then directly modify the styles based on the space available for the element. The problem with this approach is that you quickly end up in undefined situations. If you allow an element to change its own styles based on size, what happens if it changes its own size? Breakdown. The New Hope Container queries hope to solve this problem by explicitly allowing you to *only* influence child elements based on their container's size. This offers most of the benefits of an element query, without the drawback of being able to create impossible scenarios for the browser. Read the full email and get the links here: http://zurb.us/2lIbxn2 Imagine the possibilities! The promise of truly self-contained components that could be plugged into a multitude of locations within a website and "just work" opens a whole new world of design opportunities. We've gathered a list of articles exploring this concept for you to read, check them out below, and start dreaming… if container queries become a reality, what will you build? Start the new year off with training directly from the Foundation team! Our unique online Intro to Foundation course will get you up and running with the framework fast as well as provide you with some tips and tricks directly from the team that created it. Check out the course: http://zurb.com/university/foundation-intro

Niciun comentariu:

Trimiteți un comentariu