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
26
web/node_modules/jss/src/utils/createRule.js
generated
vendored
Normal file
26
web/node_modules/jss/src/utils/createRule.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
// @flow
|
||||
import warning from 'tiny-warning'
|
||||
import type {Rule, RuleOptions, JssStyle} from '../types'
|
||||
import cloneStyle from './cloneStyle'
|
||||
|
||||
/**
|
||||
* Create a rule instance.
|
||||
*/
|
||||
export default function createRule(
|
||||
name: string = 'unnamed',
|
||||
decl: JssStyle,
|
||||
options: RuleOptions
|
||||
): Rule | null {
|
||||
const {jss} = options
|
||||
const declCopy = cloneStyle(decl)
|
||||
|
||||
const rule = jss.plugins.onCreateRule(name, declCopy, options)
|
||||
if (rule) return rule
|
||||
|
||||
// It is an at-rule and it has no instance.
|
||||
if (name[0] === '@') {
|
||||
warning(false, `[JSS] Unknown rule ${name}`)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue