mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-17 13:31:52 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
3
web/node_modules/jss-plugin-props-sort/src/index.d.ts
generated
vendored
Normal file
3
web/node_modules/jss-plugin-props-sort/src/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import {Plugin} from 'jss'
|
||||
|
||||
export default function jssPluginPropsSort(): Plugin
|
27
web/node_modules/jss-plugin-props-sort/src/index.js
generated
vendored
Normal file
27
web/node_modules/jss-plugin-props-sort/src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
// @flow
|
||||
import type {Plugin} from 'jss'
|
||||
|
||||
/**
|
||||
* Sort props by length.
|
||||
*/
|
||||
export default function jssPropsSort(): Plugin {
|
||||
const sort = (prop0, prop1) => {
|
||||
if (prop0.length === prop1.length) {
|
||||
return prop0 > prop1 ? 1 : -1
|
||||
}
|
||||
return prop0.length - prop1.length
|
||||
}
|
||||
|
||||
return {
|
||||
onProcessStyle(style, rule) {
|
||||
if (rule.type !== 'style') return style
|
||||
|
||||
const newStyle = {}
|
||||
const props = Object.keys(style).sort(sort)
|
||||
for (let i = 0; i < props.length; i++) {
|
||||
newStyle[props[i]] = style[props[i]]
|
||||
}
|
||||
return newStyle
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue