Code Monkey home page Code Monkey logo

postcss-sassy-mixins's People

Contributors

andyjansson avatar mandrewdarts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

postcss-sassy-mixins's Issues

Deprecation notices

When compiling with postcss-sassy-mixins added as a processor:

Container#eachAtRule is deprecated. Use Container#walkAtRules instead.
Node#removeSelf is deprecated. Use Node#remove.

@content fails if no content object is provided

In Sass, @content is optional (if you just want what's included). E.g.

@mixin hover($color: null) {
    &:hover {
        text-decoration: underline
        color: $color;
        @content;
    }
}
label {
    @include hover(blue);        // no `@content` (i.e. {}) defined`
}

This same setup currently errors. At least @include hover(blue){} must be written. It would be nice to optionally leave any content off and simply default to having been passed an empty object.

Nested mixins

@mixin foo {
    color: red;
}

@mixin bar {
    @include foo;
    background-color: blue;
}

.baz {
    @include bar;
}

/* Result */
.baz {
    @include foo;
    background-color: blue;
}

/* Expected Result */
.baz {
    color: red;
    background-color: blue;
}

Support new css "custom properties" as arguments (and default params)

Request: Currently it seems only sassy variables (or real values) are allowed as arguments. Doing this:

@mixin paint($color){
    color: $color;
}
.icon {@include paint(  var(--color-primary) )}

Will return literally color: var(--color-primary) rather than extrapolate.


The current workaround is to simply define $color-primary: var(--color-secondary); right above and then use this sassy variable within the function.

Sass VS Scss

As per http://sass-lang.com/guide, seems to me the plugin is using Scss syntax, not Sass', which looks like this:

=transform($property)
  -webkit-transform: $property
  -ms-transform:     $property
  transform:         $property

.box
  +transform(rotate(30deg))

Unknown word @mixin

Hi, I'm migrating from sass to postcss.
I get an error trying to compile the plugin saying: Unknown word @mixin
any ideas?

this is the mixin I'm defining

@mixin rem($px) {
    ($px/16) * 1rem;
}

and this is where i use it

.header {
  font-size: @include rem(75)
}

these are the parts in my webpack config relevant to css:

var webpack         = require('webpack');
var precss          = require('precss');
var autoprefixer    = require('autoprefixer');
var mixins          = require('postcss-sassy-mixins');

module.exports = {

  module: {
    loaders: [
      {
        test:   /\.css$/,
        loader: "style-loader!css-loader?modules&importLoaders=1!postcss-loader"
      }
    ]
  },
  postcss: function () {
    return [precss, mixins, autoprefixer];
  },

  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.DefinePlugin({
      'process.env': {
        CLIENT: JSON.stringify(true)
      }
    })
  ],
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.