> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/sass/list/list.first.md).

# list.first()

The `list.first()` function returns the first element of [`$list`](#usdlist).

{% code lineNumbers="true" %}

```scss
// Sass.
@use 'sass:list';

// The `list.first()` function.
@function first($list) {
  @return if(type-of($list) == list, list.nth($list, 1), $list);
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/list/_list.first.function.scss>" %}

### Parameters

#### **`$list`**&#x20;

The list to get the first element from.

### Return

The return value is the first element of [`$list`](#usdlist).

## Examples

```scss
// Use.
@use 'angular-package/sass/list';

// Examples.
@debug list.first(('a', 'b', c, d, 2, 4, 5, (a: 1))); // ()
@debug list.first(((a: 1), 'b', c, d, 2, 4, 5, (a: 1))); // ((a: 1),)
```
