Skip to content

Small script to allow simple media queries for single DOM elements for a more responsive experience.

License

Notifications You must be signed in to change notification settings

marianrick/object-media-queries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object media queries

Assign css like media queries to single objects for a component based responsive system. This can make your front-end more flexible, more responsive and better looking in many cases.

Getting Started

Simply download and include object-media-queries.min.js in your project.

<script src="object-media-queries.min.js">

Than refer inside your DOM to different sizes, for example

<div id="example" class="fluid" data-sizes='["320", "640", "800"]'>

Finally, target the classes inside your css/sass/etc.

#example.size-320 { background: blue; }
#example.size-640 { background: red; }
#example.size-800 { background: green; }

Installing

Simply download and include object-media-queries.min.js in your project.

<script src="object-media-queries.min.js">

Contributing

Feel free to fork or add any ideas you've got.

Authors

Marian Rick

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Small script to allow simple media queries for single DOM elements for a more responsive experience.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published