new KssSection(data)
An instance of this class is returned on calling KssStyleguide.section
.
Exposes convenience methods for interpreting data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | A part of the data object passed on by |
- Source:
Methods
deprecated() → {Boolean}
Returns whether the section is deprecated or not.
- Source:
Returns:
Whether the section is deprecated or not.
- Type
- Boolean
depth() → {string}
Returns the depth of the section.
- Source:
Returns:
The depth of the section.
- Type
- string
description() → {string}
Returns the description of the section.
- Source:
Returns:
The description of the section.
- Type
- string
encodeReferenceURI(reference) → {string}
Encodes the given reference as a valid URI fragment.
Parameters:
Name | Type | Description |
---|---|---|
reference |
string | A style guide section reference. |
- Source:
Returns:
The reference encoded as a URI.
- Type
- string
experimental() → {Boolean}
Returns whether the section is experimental or not.
- Source:
Returns:
Whether the section is experimental or not.
- Type
- Boolean
firstModifier() → {false|string}
Returns the first modifier of the section.
- Source:
Returns:
The first modifier of the section, or false
if none.
- Type
- false | string
header() → {string}
Returns the header of the section.
- Source:
Returns:
The header of the section.
- Type
- string
JSON(customProperties) → {Object}
Return KssSection
as a JSON object.
Parameters:
Name | Type | Description |
---|---|---|
customProperties |
Array | A list of custom properties to include in the JSON. |
- Source:
Returns:
A JSON object representation of the KssSection.
- Type
- Object
markup() → {false|string}
Returns the markup of the section.
- Source:
Returns:
The markup of the section, or false
if none.
- Type
- false | string
modifiers(query) → {false|Array}
Returns the requested modifier of the section.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | int | The name (string) or 0-based index (int) of the requested modifier. |
- Source:
Returns:
An Array of KssModifier objects, or false
if none.
- Type
- false | Array
parameters() → {Array}
Returns the parameters if the section is a CSS preprocessor function/mixin.
- Source:
Returns:
The parameters of the section.
- Type
- Array
reference() → {string}
Returns the reference of the section.
- Source:
Returns:
The reference of the section.
- Type
- string
referenceURI() → {string}
Returns the reference of the section, encoded as a valid URI fragment.
- Source:
Returns:
The description of the section.
- Type
- string
weight() → {string}
Returns the weight of the section.
- Source:
Returns:
The weight of the section.
- Type
- string