GithubHelp home page GithubHelp logo

jaicab / sass-vary Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 4.0 4.13 MB

Consistent theming with BEM modifiers, body classes and more!

Home Page: http://jaicab.com/sass-vary/

License: MIT License

CSS 100.00%

sass-vary's People

Contributors

jaicab avatar kittygiraudel 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sass-vary's Issues

New creation mode: combine

It has been suggested to have a creation mode where the "body class" (which will be now referred as class) got added to the selector. Here's an example:

.js .foo{
    background: red;

    @include vary($create: combine) {
        background: vary-get('color-primary');
    }
}

Output:

.foo{
    background: red;    
}

.js .foo.is-user {
    background: blue;
}

.js .foo.is-admin {
    background: pink;
}

.js .foo.is-superadmin {
    background: black;
}

Although not recommended, could be useful for some. May be implementing this soon.

Ideas for more representative $create keywords

Aware of the possible confusion with the current keywords for $create (body, htmlbody, mod and custom) and seeing the feedback, it would be good to come up with more representative keywords for the $create parameter.

Feel free to comment any ideas for keywords you may have and I'll pick the ones that people like the most. Keep in mind that they need to be scalable as more creation methods may be added in the future.

Allow customisable default argument create argument of vary

If I'm a heavy user of BEM-style selectors, allow me to set the default for the create argument of the vary mixin, rather than having to hardcode it everywhere:

$vary-default-create: 'mod'.

@include vary() {}

In fact choosing a default value anyway wouldn't be a bad idea.

Support lookup within map

It is probably worth considering allowing one key in a vary map to reference another key. This could be done with a token:

( primary-color: #FF000,
secondary-color: #00FF00,
button-color: '#{primary-color}',
tab-color: '#{primary-color}',
button-secondary-color: '#{primary-color}');

I guess this is related to #10 in terms of how flexible should Vary be.

Theming Fonts

Hi,

First of all, thanks for the mixin. It is awesome.

I would like to know if there is a way to provide theming for fonts, especially Google Fonts.

Support Nested Vary Object

Worth considering supporting a nested Vary object:

$vary-map: (
  user: (
    'color':  (
       'primary': red,
       'secondary: blue
    )
  ),
) !default;

With a lookup:

@include vary($create: parent) {
    background: vary-get('color primary');
    color vary-get('color secondary');
  }

This would allow for better organisation of theme values; they could be more easily organised by type (color, font etc) or by component (button, tabs, etc).

Currently this kind of organisation is possible only through naming the keys must convey the structure eg.

tabs.tab.background-color`,
tabs.tab.font-face`

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.