
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Lightweight Sass library to manage responsive breakpoints and generate to media queries
mq-sass is a lightweight Sass library to help you manage your responsive breakpoints and easily generate media queries.
bower install mq-sass -D
@import "bower_components/mq-sass/styleshets/mq-sass";
If you're using Grunt, Gulp, Compass, or alike, include/import mq-sass:
# Compass config.rb
add_import_path "bower_components/mq-sass/stylesheets"
// grunt-sass Gruntfile.js
options: {
includePaths: ['bower_components/mq-sass/stylesheets']
},
Then import mq-sass at the top of your Sass file.
@import "mq-sass";
sass/mq-sass/
)@import "sass/mq-sass/mq-sass";
@include mq($breakpoint, $minmax) {
// Sass goes here
}
$mq-breakpoints: (
iphone : 320px,
iphone6 : 375px,
iphone6p: 414px,
small : 480px,
medium : 640px,
ipad : 768px,
large : 1024px,
);
$mq-ems : false;
$mq-em-base: 16px;
$mq-only: "only screen";
$breakpoint
$breakpoint
, accepts pre-defined values from the $mq-breakpoints();
map, which is set by default as above in Settings.Example:
@include mq(small) {
color: white;
}
/* Resulting CSS */
@media only screen and (min-width: 480px) {
color: white;
}
You can also customize your own breakpoints.
$mq-breakpoints: (
s : 600px,
m : 800px,
l : 1000px,
xl: 1200px,
);
@include mq(xl) {
color: blue;
}
$breakpoint
also accepts other pre-defined values:Example:
@include mq(portrait) {
color: white;
}
@include mq(retina) {
color: red;
}
/* Resulting CSS */
@media only screen and (orientation: portrait) {
color: white;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 2dppx) {
color: red;
}
$breakpoint
accepts custom values in px.Example:
@include mq(700px) {
color: white;
}
/* Resulting CSS */
@media only screen and (min-width: 700px) {
color: white;
}
Note: You can also use unitless pixel values: @include mq(700) {}
$minmax
By default, media queries are mobile first (min-width
).
$minmax
accepts values min
or max
, which will result in min-width:
or max-width:
respectively. If left blank, it falls back to the default, min
.
Example:
@include mq(ipad) {
color: white;
}
@include mq(ipad, max) {
color: blue;
}
@include mq(600px) {
color: magenta;
}
@include mq(600px, max) {
color: cyan;
}
/* Resulting CSS */
@media only screen and (min-width: 768px) {
color: white;
}
@media only screen and (max-width: 768px) {
color: blue;
}
@media only screen and (min-width: 600px) {
color: magenta;
}
@media only screen and (max-width: 600px) {
color: cyan;
}
To have media queries in ems, set $mq-ems: true;
. The default em base is 16px
. You can change it by setting $mq-em-base
to the pixel value of your choosing.
Examples:
$mq-ems: true;
@include mq(600px) {
color: white;
}
/* Resulting CSS */
@media only screen and (min-width: 37.5em) {
color: white;
}
$mq-ems : true;
$mq-em-base: 20px;
@include mq(600px) {
color: cyan;
}
/* Resulting CSS */
@media only screen and (min-width: 30em) {
color: cyan;
}
By default the media is specified for only screen
. For some reason if you'd like to change it or remove it completely, you can do so by changing the setting $mq-media
:
$mq-media: "screen";
/* Resulting CSS */
@media screen and (min-width...) {}
$mq-media: ""; // or false
/* Resulting CSS */
@media (min-width...) {}
The MIT License
Copyright © 2014 Jonathan Suh (@jonsuh)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[0.2.0] - 05/28/2015
FAQs
Sass library to manage responsive breakpoints and generate to media queries
The npm package mq-sass receives a total of 135 weekly downloads. As such, mq-sass popularity was classified as not popular.
We found that mq-sass demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.