iamstarkov / jss-increase-specificity

Increases specificity of selectors. Port of postcss-increase-specificity
11 stars 1 forks source link

unexpected result #1

Closed Mavtak closed 7 years ago

Mavtak commented 7 years ago

neat plugin! I can't get it to work, though... when I run this code:

var jss = require('jss').default;
var increaseSpecificity = require("jss-increase-specificity");
var preset = require('jss-preset-default').default;

jss
  .setup(preset())
  .use(increaseSpecificity());

const styles = {
  button: {
    fontSize: 12,
  },
};

console.log(jss.createStyleSheet(styles).toString());

I get this output:

".button-0-0 {\n font-size: 12px;\n}"

but I'd expect the output to be:

":root:root:root .button-0-0 {\n font-size: 12px;\n}"

any idea what might be wrong? thanks!

iamstarkov commented 7 years ago

Hi, @Mavtak

Thanks for trying it out.

what are you package.json?

Mavtak commented 7 years ago

the code I put on this web app should demonstrate:

https://runkit.com/58f11b72af30250012d45fe1/58f11b72af30250012d45fe2/branches/master

Mavtak commented 7 years ago

^ it's using jss 7.0.3, jss-increase-specificity 0.1.0, and jss-preset-default 2.0.0

iamstarkov commented 7 years ago

@Mavtak pls, try the latest version and say if it works and please report otherwise