Skip to content

Instantly share code, notes, and snippets.

@markdalgleish
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markdalgleish/f1a74e82f7a9f0d77e2b to your computer and use it in GitHub Desktop.
Save markdalgleish/f1a74e82f7a9f0d77e2b to your computer and use it in GitHub Desktop.
Potential postcss-local-scope / css-loader optimisation
.foo {
font-family: helvetica, arial, sans-serif;
font-size: 16px;
color: red;
}
.bar {
font-family: helvetica, arial, sans-serif;
font-size: 16px;
color: blue;
}
.shared_hash {
font-family: helvetica, arial, sans-serif;
font-size: 16px;
}
.hash_1 {
color: red;
}
.hash_2 {
color: blue;
}
module.exports = {
foo: 'shared_hash hash_1',
bar: 'shared_hash hash_2'
};
@sokra
Copy link

sokra commented May 21, 2015

Related:
https://github.com/webpack/css-loader#inheriting
https://gist.github.com/sokra/94fbd110e78b2cb4daf0

Just output it into this format with a postcss plugin.

@markdalgleish
Copy link
Author

Wow, this looks great. This is going to let us do some really amazing things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment