MCPcopy
hub / github.com/postcss/autoprefixer / set

Method set

lib/hacks/flex.js:30–44  ·  view source on GitHub ↗

* Spec 2009 supports only first argument * Spec 2012 disallows unitless basis

(decl, prefix)

Source from the content-addressed store, hash-verified

28 * Spec 2012 disallows unitless basis
29 */
30 set(decl, prefix) {
31 let spec = flexSpec(prefix)[0]
32 if (spec === 2009) {
33 decl.value = list.space(decl.value)[0]
34 decl.value = Flex.oldValues[decl.value] || decl.value
35 return super.set(decl, prefix)
36 }
37 if (spec === 2012) {
38 let components = list.space(decl.value)
39 if (components.length === 3 && components[2] === '0') {
40 decl.value = components.slice(0, 2).concat('0px').join(' ')
41 }
42 }
43 return super.set(decl, prefix)
44 }
45}
46
47Flex.names = ['flex', 'box-flex']

Callers 4

regexpMethod · 0.45
declMethod · 0.45
loadPrefixesFunction · 0.45
insertMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected