Skip to main content

separator ()

Signatures

separator ()

Returns an error message stating a separator variable received the wrong value.

Details

Return Value

String
A string describing what values are acceptable for a separator.
separator ( $context )

Returns an error message stating a separator parameter received the wrong value.

Details

Parameters

$context
The name of the function or mixin issuing the error.
Type
String

Return Value

String
A string describing what values are acceptable for a separator.

Example

@sass-fairy/list/src/_set-nth.sass
// Copyright (c) roydukkey. All rights reserved.
// Licensed under the MIT. See LICENSE file in the project root for full license information.

@use 'sass:list'
@use 'sass:meta'
@use '@sass-fairy/exception'


@function set-nth($list, $index, $value, $separator: auto)
$index: exception.validate-index('set-nth', 'index', $index, $list)

@if meta.type-of($index) != 'number'
@error $index

@if exception.is-separator-invalid($separator)
@error exception.separator('set-nth')

@return list.join(list.set-nth($list, $index, $value), (), $separator)