Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/jss-plugin-vendor-prefixer/src/ drwxr-xr-x | |
| Viewing file: Select action/file-type: // @flow
import * as vendor from 'css-vendor'
import {toCssValue, type Plugin, type KeyframesRule} from 'jss'
/**
* Add vendor prefix to a property name when needed.
*
* @api public
*/
export default function jssVendorPrefixer(): Plugin {
function onProcessRule(rule) {
if (rule.type === 'keyframes') {
const atRule: KeyframesRule = (rule: any)
atRule.at = vendor.supportedKeyframes(atRule.at)
}
}
function prefixStyle(style) {
for (const prop in style) {
const value = style[prop]
if (prop === 'fallbacks' && Array.isArray(value)) {
style[prop] = value.map(prefixStyle)
continue
}
let changeProp = false
const supportedProp = vendor.supportedProperty(prop)
if (supportedProp && supportedProp !== prop) changeProp = true
let changeValue = false
const supportedValue = vendor.supportedValue(supportedProp, toCssValue(value))
if (supportedValue && supportedValue !== value) changeValue = true
if (changeProp || changeValue) {
if (changeProp) delete style[prop]
style[supportedProp || prop] = supportedValue || value
}
}
return style
}
function onProcessStyle(style, rule) {
if (rule.type !== 'style') return style
return prefixStyle(style)
}
function onChangeValue(value, prop) {
return vendor.supportedValue(prop, toCssValue(value)) || value
}
return {onProcessRule, onProcessStyle, onChangeValue}
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0049 ]-- |