Skip to content

Commit

Permalink
feat: 🎸 allow JS-style snake-case declaration properties
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 22, 2019
1 parent 381da93 commit 9b8197a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .storybook/vcssom/hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const Demo = () => {
const className = useCss({
color: 'red',
border: '1px solid red',
fontWeight: 'bold',
'&:hover': {
color: 'blue',
},
Expand Down
6 changes: 4 additions & 2 deletions addon/vcssom.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ function removeRule (sh, rule) {

exports.addon = function (renderer) {
if (process.env.NODE_ENV !== 'production') {
require('./__dev__/warnOnMissingDependencies')('pipe', renderer, ['createRule']); // cssom
require('./__dev__/warnOnMissingDependencies')('cssom', renderer, ['createRule']); // cssom
}

var kebab = renderer.kebab;

function VRule (rule, decl) {
this.rule = rule;
this.decl = decl;
Expand All @@ -77,7 +79,7 @@ exports.addon = function (renderer) {

for (property in newDecl) {
if (newDecl[property] !== oldDecl[property]) {
style.setProperty(property, newDecl[property]);
style.setProperty(kebab(property), newDecl[property]);
}
}

Expand Down

0 comments on commit 9b8197a

Please sign in to comment.