Element responsiveness for a modern web
An event-based CSS element dimension query library with valid CSS selector syntax to change styles and allow responsive images based on element's dimensions and not window's viewport.
It's exactly what we need when it comes to responsive Web Components.
Installation DownloadDownload the zip file using the buttons on the right side and include both files at the head section of your page. ElementQueries start automatically to listen to
window.load eventand parses all available css files to attach the ResizeSensor and start the magic.
NPMnpm install css-element-queries --save
HighlightsDrag the gray line at the right to see it in action.
Responsive Text Element responsiveness FTW! Responsive ImageThe image above has a default of 700px. Shrink or expend the container too see responsive image working. Thanks
@placehold.it Responsive Widget Demo 1 This is content from the first responsive demo without media queries. It uses the element queries provided by this library. Responsive Layout Demo 2Box
First 1/2 box
Second 1/2 box
Responsive Animation Demo 3 - widthThis box is animated through css transitions. We attached a resize-listener to this box. See below.
No changes.
Demo 4 - heightThis box is animated through css transitions. We attached a resize-listener to this box. See below.
No changes.
ResizeSensor DemoCSS-Element-Queries comes with a Javascript ResizeSensor class you can use in Javascript directly.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4