Jss: [jss-nested] @-rules inside of regular rules

Created on 23 Jun 2016  路  16Comments  路  Source: cssinjs/jss

  • [ ] Sometimes it is more practical to have @-rules like @media inside of a regular rule.
  • [ ] When extending a rule with an at-rule inside, all of them should apply to the extended rule
return {
  button: {
    fontSize: 12,
    '@media (min-width: 1024px)': {
      width: 200
    }
  },
  ctaButton: {
    extend: 'button',
    '&:hover': {
      background: 'red'
    }
  }
}
idea

Most helpful comment

released

All 16 comments

Hi, I would like to try implementing this. Could you give me some pointers to get started?

Allright, create a repo, take jss-nested as a template. Let me know on gitter if you need help.

Hmm, maybe it could be even part of jss-nested instead of a separate plugin.

In this case you may want to fork jss-nested and try to add this functionality.

Let me know if this requires any changes in core.

@alebiavati any updates?

@kof @alebiavati any updates on that topic? tried to implement that feature as well and it seems strait forward. One question is how to test in combination with jss-extend. Where should we place tests where several plugins are involved?

I think it is ok to add a plugin as a dev dependency and just add tests for it right away.

all right then I will add the testcases and formulate a PR.
@kof Is there already some utility to merge styles of a rule?

using es6 {...}

of course :)

Sorry for the delay, I couldn't find the time to work on it. Thanks @johann-sonntagbauer for picking this up!

@johann-sonntagbauer this feature is very important because after we have it, I will create an official release of https://github.com/cssinjs/aphrodisiac

oh nice ;) i will finalize over the weekend

@kof
formulated a PR with the changes. Added the missing test case with jss-extend.
https://github.com/cssinjs/jss-nested/pull/14

released

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Telokis picture Telokis  路  3Comments

mg901 picture mg901  路  3Comments

oliviertassinari picture oliviertassinari  路  4Comments

pofigizm picture pofigizm  路  5Comments

HenriBeck picture HenriBeck  路  4Comments