Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix prefix after value-function #1388

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/jss-plugin-vendor-prefixer/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import * as vendor from 'css-vendor'
import {toCssValue, type Plugin, type KeyframesRule} from 'jss'
import {toCssValue, type Plugin, type KeyframesRule, type StyleRule} from 'jss'

/**
* Add vendor prefix to a property name when needed.
Expand Down Expand Up @@ -48,6 +48,13 @@ export default function jssVendorPrefixer(): Plugin {
function onChangeValue(value, prop) {
return vendor.supportedValue(prop, toCssValue(value)) || value
}

function onUpdate(data, rule, sheet, options) {
// Prefix after value-function
if (rule.type === 'style') {
prefixStyle((rule: StyleRule).style);
}
}

return {onProcessRule, onProcessStyle, onChangeValue}
return {onProcessRule, onProcessStyle, onChangeValue, onUpdate}
}