Shorthand Syntax Parser
The syntax parser converts shorthand syntax into a map of settings that can be compared/merged with other config maps and global setting.
@function susy-parse()
The parse
function provides all the syntax-sugar in Susy,
converting user shorthand
into a usable map of keys and values
that can be normalized and passed to Su.
Parameters & Return
$shorthand: (list)
Shorthand expression to define the width of the span, optionally containing:
- a count, length, or column-list span;
at $n
,first
, orlast
location on asymmetrical grids;narrow
,wide
, orwider
for optionally spreading across adjacent gutters;of $n <spread>
for available grid columns and spread of the container (span counts likeof 6
are only valid in the context of symmetrical grids);- and
set-gutters $n
to override global gutter settings
$context-only: false (bool)
Allow the parser to ignore span and span-spread values,
only parsing context and container-spread.
This makes it possible to accept spanless values,
like the gutters()
syntax.
When parsing context-only,
the of
indicator is optional.
@return (map)
Map of span and grid settings
parsed from shorthand input –
including all the properties available globally –
columns
, gutters
, spread
, container-spread
–
along with the span-specific properties
span
, and location
.
@error
when a shorthand value is not recognized