Accoutrement 2.1.1

List Functions

Functions for basic Sass-list manipulation. While these functions are defined with private prefixes, they are registered without the prefix for map-access.

@function remove-nth()

Remove any item (1-indexed) from a list.

This function is prefixed outside maps & should not be used directly, but is available in all accoutrement maps under the 'remove-nth' alias.

Parameters & Return

$list: (list)

The original list to be edited

$index: (number)

The 1-indexed item to remove from the list

@return (list)

The original list, with item removed

@error

$index must be a non-zero integer

@error

$index is too large for the list length

Example

scss
$map: (
  'main-start': ['nav-end' 'main-start' 'footer-start'],
  'small-start': '#main-start' ('remove-nth': 1),
);
/*! #{inspect(get-token($map, 'small-start'))} */
css compiled
/*! ["main-start" "footer-start"] */

Requires

@function _a_list-template() [private]

@function _a_error() [private]