Accoutrement 2.1.1

Inspecting Tokens

Tools for inspecting accoutrement map token meta-data, useful for building more complicated logic for automation and integrations.

@function is-private-token()

Check if a token key is marked as private with _ or - as the starting character

Since 2.0.0:

  • NEW: Initial release

Parameters & Return

$key: (*)

The token key to check for private prefix (only string and list keys can be marked as private)

@return (boolean)

True if the key is private, otherwise false

Example

scss
/*! #{is-private-token('_private-token')} */
/*! #{is-private-token('public-token')} */
css compiled
/*! true */
/*! false */

Used By

@function var-contrast()

@function is-alias-for()

@mixin tokens--()

@function _a_normalize-font-name() [private]

@function is-alias-for()

Find if a token is simply an alias, and (if so) what token it represents – either directly, or following the thread to it’s origin.

Since 2.0.0:

  • NEW: Initial release

Parameters & Return

$map: (map)

A map of terms to reference against

$token: (*)

The token name to be traced

$origin: false (*)

False to trace the alias one step back, or true to trace an alias thread back to the original source token

@return (*)

false for non-alias tokens, or the name of an alias source (either one step back, or the full origin of multiple aliases)

Example

scss
$colors: (
  '_brand': hsl(120, 50%, 50%),
  'text': '#_brand',
  'border': '#text',
  'outline': '#border',
);
/*! _brand: #{is-alias-for($colors, '_brand')} */
/*! text: #{is-alias-for($colors, 'text')} (_brand is private) */
/*! border: #{is-alias-for($colors, 'border')} */
/*! outline: #{is-alias-for($colors, 'outline', $origin: true)} */
css compiled
/*! _brand: false */
/*! text: false (_brand is private) */
/*! border: text */
/*! outline: text */

Requires

@function is-private-token()

Used By

@mixin token--()

@function _a_normalize-font-name() [private]

@function _a_font-values() [private]