New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

postcss-responsive-properties

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-responsive-properties

PostCSS plugin that will make writing responsive style more easily

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

PostCSS Responsive Properties Build Status

PostCSS plugin that will make writing responsive style more easily.

Input:

body {
  color: red;
  font-size: {
    0: 1em;
    $tablet: 1.5em; /* use it with variables */
    1600: 2em;
  }
}

Output:

body {
  color: red;
  font-size: 1em
}

@media screen and (min-width: $tablet) { /* use it with variables */
  body {
    font-size: 1.5em;
  }
}

@media screen and (min-width: 1600px) {
  body {
    font-size: 2em;
  }
}

Usage

Install postcss and postcss-responsive-properties to your project:

npm i postcss postcss-responsive-properties --save

Using with PostCSS:

var postcss = require("postcss"),
    responsiveCSSProperties = require("postcss-responsive-properties");

postcss([ responsiveCSSProperties ])
    .process(css, { from: "src/input.css", to: "dist/output.css" })
    .then(function (result) {
        fs.writeFileSync("dist/output.css", result.css);
        if ( result.map ) fs.writeFileSync("dist/output.css.map", result.map);
});

Using with gulp:

npm i gulp gulp-postcss postcss-responsive-properties --save
var gulp = require("gulp"),
    postcss = require("gulp-postcss"),
    responsiveCSSProperties = require("postcss-responsive-properties");

gulp.task("styles", function() {
    var processors = [ responsiveCSSProperties ];

    return gulp.src("src/input.css")
        .pipe(postcss(processors).on("error", function(err) { console.log(err)}))
        .pipe(gulp.dest("dist/output.css"));
});

See PostCSS docs for examples for your environment.

Keywords

postcss

FAQs

Package last updated on 31 Jan 2018

Did you know?

Socket

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.

Install

Related posts