- findInvalidLayoutProperties(css) ⇒
array
This function extracts any css propertuy names that do not relate to external layout, such as color, background or padding. This is useful for validating compsing css and presenting the invalid properties in an error.
Example:
import { findInvalidLayoutProperties } from '@layout-css/validator'
const invalidLayoutProperties = findInvalidLayoutProperties(css);
- isValidLayout(css) ⇒
boolean
This function validates that a block of css only includes layout and not properties that modifies appearance.
Example:
import { isValidLayout } from '@layout-css/validator'
const isLayout = isValidLayoutExcluding(css, ['margin']);
- isValidLayoutExcluding(css, exclude) ⇒
boolean
This function validates that a block of css only includes layout, excluding the passed properties.
This will also exclude any related shorthand, longhand and prefixed properties. For instance, excluding flex-basis will also exclude flex, since flex includes flex-basis. propertiesExcluding flex, will also remove flex-grow, flex-shrink, flex-basis and all related vender prefixed versions.
Example:
import { isValidLayoutExcluding } from '@layout-css/validator'
const isLayout = isValidLayoutExcluding(css, ['margin']);
This function extracts any css propertuy names that do not relate to external layout, such as color, background or padding. This is useful for validating compsing css and presenting the invalid properties in an error.
Example:
import { findInvalidLayoutProperties } from '@layout-css/validator'
const invalidLayoutProperties = findInvalidLayoutProperties(css);
Kind: global function
Returns: array
- .
Param | Type | Description |
---|---|---|
css | string |
A block of css for validation. |
This function validates that a block of css only includes layout and not properties that modifies appearance.
Example:
import { isValidLayout } from '@layout-css/validator'
const isLayout = isValidLayoutExcluding(css, ['margin']);
Kind: global function
Returns: boolean
- .
Param | Type | Description |
---|---|---|
css | string |
A block of css for validation. |
This function validates that a block of css only includes layout, excluding the passed properties.
This will also exclude any related shorthand, longhand and prefixed properties. For instance, excluding flex-basis will also exclude flex, since flex includes flex-basis. propertiesExcluding flex, will also remove flex-grow, flex-shrink, flex-basis and all related vender prefixed versions.
Example:
import { isValidLayoutExcluding } from '@layout-css/validator'
const isLayout = isValidLayoutExcluding(css, ['margin']);
Kind: global function
Returns: boolean
- .
Param | Type | Description |
---|---|---|
css | string |
A block of css for validation. |
exclude | array |
An array of properties to remove from the layout properties list. |