SassList
A Sass list value.
Sass lists have a separator and may be surrounded with brackets.
All Sass values can be treated as lists so much list-like behavior is available via
SassValue
. SassList
is mostly useful for constructing your own multi-element lists.
Topics
Types
enum Separator
enum Separator
Initializers
init<C>(C, separator: Separator, hasBrackets: Bool)
init<C>(C, separator: Separator, hasBrackets: Bool)
Initialize a new list with the contents of a Swift sequence.
Declaration
Parameters
sequence |
The |
separator |
The separator character to use in any CSS generated from the list.
If |
hasBrackets |
Whether the list should display with brackets. Normally |
Properties
var separator: Separator
var separator: Separator
var hasBrackets: Bool
var hasBrackets: Bool
var listCount: Int
var listCount: Int
The number of values in this value viewed as a list.
Declaration
public override var listCount: Int { get }
Methods
func valueAt(sassIndex: SassValue) -> SassValue
func valueAt(sassIndex: SassValue) -> SassValue
Subscript the value using a Sass list index.
(Swift can’t throw exceptions from subscript
).
Declaration
Parameters
sassIndex |
A Sass value intended to be used as an index into this value viewed as a list. This must be an integer between 1 and the number of elements inclusive, or a negative number with similar magnitude to index back from the end. |
Throws
SassFunctionError
if sassIndex
is not an integer or out of range.
Return Value
The value at the Sass index.
Misc
static func ==(lhs: SassList, rhs: SassList) -> Bool
static func ==(lhs: SassList, rhs: SassList) -> Bool
func hash(into: inout Hasher)
func hash(into: inout Hasher)
Hashes the list’s properties and contents.
Declaration
public override func hash(into hasher: inout Hasher)
func makeIterator() -> AnyIterator<SassValue>
func makeIterator() -> AnyIterator<SassValue>
An iterator for the values in the list.
Declaration
public override func makeIterator() -> AnyIterator<SassValue>
func accept<V, R>(visitor: V) -> R
func accept<V, R>(visitor: V) -> R
Call the corresponding method of visitor
against this object.
Declaration
public override func accept<V, R>(visitor: V) throws -> R
where V: SassValueVisitor, R == V.ReturnType
var description: String
var description: String