# @talenra/stylebox

> SCSS-flavoured ready-to-use design basics and style presets for Talenra Workspace

Latest version **21.2.4** (published 2026-05-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install @talenra/stylebox
pnpm add @talenra/stylebox
yarn add @talenra/stylebox
bun add @talenra/stylebox
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 21.2.4 |
| Published | 2026-05-26 |
| First published | 2022-07-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | talenra |
| Keywords | SCSS, CSS, style, design, preset, util |

## Links

- npm: https://www.npmjs.com/package/@talenra/stylebox
- Repository: https://gitlab.com/talenra/workspace
- Homepage: https://gitlab.com/talenra/workspace#readme
- Issues: https://gitlab.com/talenra/workspace/issues
- npm.io page: https://npm.io/package/@talenra/stylebox

## Dependencies (1)

- [@pixelherz/sassbox](https://npm.io/package/@pixelherz/sassbox.md) ^2.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 21.2.4 (latest) — 2026-05-26
- 21.2.1 — 2026-04-30
- 21.2.0 — 2026-04-04
- 8.0.0 — 2025-06-27
- 7.0.0 — 2025-05-30
- 6.3.2 — 2025-05-29
- 6.3.1 — 2025-05-22
- 6.3.0 — 2025-05-04
- 6.2.0 — 2025-04-07
- 6.1.0 — 2025-04-04
- 6.0.0 — 2025-03-08
- 5.0.0 — 2025-02-15
- 4.7.0 — 2025-02-02
- 4.6.0 — 2024-11-05
- 4.5.0 — 2024-10-26
- … 4 more at https://npm.io/package/@talenra/stylebox/versions

## README

# Talenra – Stylebox library for Sass

SCSS-flavoured ready-to-use design basics and style presets for Talenra Workspace

## Contents

- [Installation](#installation)
- [Usage](#usage)
  - [Breakpoints](#usage)
    - [bp-get($name)](#bp-getname)
  - [Colors](#colors)
    - [color-get($name, $tint)](#color-getname-tint)
  - [Effects](#effects)
    - [Border radius](#border-radius)
    - [effect-use-drop-shadow()](#effect-use-drop-shadow)
  - [Typography](#typography)
    - [type-get-font()](#type-get-font)
    - [type-use-font()](#type-use-font)
    - [type-use($preset, $weight, $style, $flowtext, $suppress)](#type-usepreset-weight-style-flowtext-suppress)
  - [Sassbox](#sassbox)
- [Contributing](#contributing)
- [Versioning](#versioning)
- [License](#license)
- [Contact](#contact)

## Installation

Add the `@talenra` registry to your `.npmrc`.

```
npm config set @talenra:registry=https://registry.npmjs.org/
npm login --scope=@talenra
```

Install the package.

```ssh
npm i @talenra/stylebox
```

If you plan to use the [typographic features](#typography) of this library, you have to implement the required fonts in your app.

```html
<!-- Place these lines in the header section of the index.html at the root of your app to load the required fonts. -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300&display=swap" rel="stylesheet" />
```

## Usage

Import the complete toolbox in your project.

```scss
// Import stylebox
@use '@talenra/stylebox';
```

### Breakpoints

#### bp-get($name)

```scss
// Import stylebox
@use '@talenra/stylebox';

@media screen
and (max-width: #{stylebox.bp-get($name: "use-overlay-until") - 0.1px}) {
  // Styles for "overlay layout"
}
```

For media queries like above you might want to use the included and pre-configured media query manager ([sass-mq](https://github.com/sass-mq/sass-mq)). This is how the media query from the example above is written using sass-mq:

```scss
// Import stylebox
@use '@talenra/stylebox';

@include stylebox.mq($until: 'use-overlay-until') {
  // Styles for "overlay layout"
}
```

##### Parameters

|  Param       | Default Value |  Description                               |
| ------------ | ------------- | ------------------------------------------ |
|  str `$name` |  `null`       |  Breakpoint name, e.g. `use-overlay-until` |

The table below shows all supported breakpoint names.

|  Breakpoint Name          |    Value |  Description                                                                                 |
| ------------------------- | -------: | -------------------------------------------------------------------------------------------- |
| `use-overlay-until`       |   1200px | Use overlay-style layout for side-navigation and panels for viewports < `use-overlay-until`. |
| `use-panel-medium-from`   |   1588px | Use medium-sized panels for viewports >= `use-panel-medium-from`.                            |
| `use-panel-max-from`      |   1834px | Use max-sized panels for viewports >= `use-panel-max-from`.                                  |
| `use-sidenav-medium-from` |   1217px | Use medium-sized side-navigation for viewports >= `use-sidenav-medium-from`.                 |
| `use-sidenav-max-from`    | 1687.5px | Use max-sized side-navigation for viewports >= `use-sidenav-max-from`.                       |

Note that the suffix `-until` _excludes_ the given boundary while `-from` _includes_ it (e.g. overlay-style is used for viewports _smaller_ 1200px while medium-sized panels are used for viewports of 1588px width).

### Colors

#### color-get($name, $tint)

```scss
// Import stylebox
@use '@talenra/stylebox';

.title {
  // Use stylebox-color in your stylesheet
  color: stylebox.color-get('black', 80); // #333333
  color: stylebox.color-get('black', 80, 'RGB'); // 51, 51, 51
  color: stylebox.color-get('black', $model: 'RGB'); // 0, 0, 0
}
```

##### Parameters

|  Param         | Default Value | Description                                             |
| -------------- | ------------: | ------------------------------------------------------- |
|  str `$name`   |        `null` | Color name, e.g. `'black'`                              |
|  int `$tint`   |         `100` | Tint, e.g. `80`                                         |
|  enum `$model` |         `HEX` | Color format of the value returned (`'HEX'` or `'RGB'`) |

The table below shows all supported color names and tints.

| Color Name    |  Tint | Swatch                                                       |
| ------------- | ----: | ------------------------------------------------------------ |
| black         |   100 |  ![#000000](http://via.placeholder.com/15/000000/000?text=+) |
|               |    80 |  ![#333333](http://via.placeholder.com/15/333333/000?text=+) |
|               |    70 |  ![#4D4D4D](http://via.placeholder.com/15/4D4D4D/000?text=+) |
|               |    60 |  ![#666666](http://via.placeholder.com/15/666666/000?text=+) |
|               |    50 |  ![#808080](http://via.placeholder.com/15/808080/000?text=+) |
|               |    40 |  ![#999999](http://via.placeholder.com/15/999999/000?text=+) |
|               |    30 |  ![#B3B3B3](http://via.placeholder.com/15/B3B3B3/000?text=+) |
|               |    20 |  ![#CCCCCC](http://via.placeholder.com/15/CCCCCC/000?text=+) |
|               |    10 |  ![#E6E6E6](http://via.placeholder.com/15/E6E6E6/000?text=+) |
|               |     5 |  ![#F2F2F2](http://via.placeholder.com/15/F2F2F2/000?text=+) |
|               |     2 |  ![#F8FBFF](http://via.placeholder.com/15/F8FBFF/000?text=+) |
| white         |       | ![#FFFFFF](http://via.placeholder.com/15/FFFFFF/000?text=+)  |
| petrol-dark   |   100 |  ![#005F71](http://via.placeholder.com/15/005F71/000?text=+) |
|               |     5 |  ![#F4F6F7](http://via.placeholder.com/15/F4F6F7/000?text=+) |
| petrol        |   100 |  ![#0099A8](http://via.placeholder.com/15/0099A8/000?text=+) |
|               |    20 |  ![#D8EBEE](http://via.placeholder.com/15/D8EBEE/000?text=+) |
|               |    10 |  ![#EAF4F6](http://via.placeholder.com/15/EAF4F6/000?text=+) |
| denim-dark    |   100 |  ![#04466A](http://via.placeholder.com/15/04466A/000?text=+) |
|               |     5 |  ![#F4F6F7](http://via.placeholder.com/15/F4F6F7/000?text=+) |
| denim         |   100 |  ![#0069A3](http://via.placeholder.com/15/0069A3/000?text=+) |
|               |    20 |  ![#CCE1ED](http://via.placeholder.com/15/CCE1ED/000?text=+) |
|               |    10 |  ![#E5F0F6](http://via.placeholder.com/15/E5F0F6/000?text=+) |
| status-green  |   100 |  ![#00d000](http://via.placeholder.com/15/00d000/000?text=+) |
| status-red    |   100 |  ![#E20057](http://via.placeholder.com/15/E20057/000?text=+) |
| status-orange |   100 |  ![#E26000](http://via.placeholder.com/15/E26000/000?text=+) |
| status-violet |   100 |  ![#B103C7](http://via.placeholder.com/15/B103C7/000?text=+) |

##### Return Value

Returns the HEX value of the given color/tint. The function will warn you about invalid color names and tints and return a fancy replacement color (`deeppink`).

### Effects

#### Border radius

Presets for border-radiuses used for rounded corners.

| name | value |
| ---- | ----- |
| s\*  | 3px   |
| m    | 6px   |

\*) Default value used if parameter `$preset` is omitted.

##### effect-get-border-radius()

```scss
// Import stylebox
@use '@talenra/stylebox';

.pane {
  // Use default border-radius default value in your stylesheet
  border-radius: stylebox.effect-get-border-radius();
}

.rounded {
  // Use with a non-default preset
  border-radius: stylebox.effect-get-border-radius('m');
}
```

###### Parameters

none

###### Return Value

Returns the `border-radius` default value. Get the value if you need it for further calculations. If you only need to apply the border-radius you should use [effect-use-border-radius](#effect-use-border-radius).

##### effect-use-border-radius()

```scss
// Import stylebox
@use '@talenra/stylebox';

.pane {
  // Apply border-radius in your stylesheet
  @include stylebox.effect-use-border-radius();
}

.rounded {
  // Use with a non-default preset
  @include stylebox.effect-use-border-radius('m');
}
```

###### Parameters

none

###### Return Value

Applies the default `border-radius` definition.

#### effect-use-drop-shadow()

```scss
// Import stylebox
@use '@talenra/stylebox';

.pane {
  // Apply drop-shadow in your stylesheet
  @include stylebox.effect-use-drop-shadow();
}
```

##### Parameters

none

##### Return Value

Applies the default `box-shadow` definition.

### Typography

#### type-get-font()

```scss
// Import stylebox
@use '@talenra/stylebox';
@use '~other-lib' with (
  $font: stylebox.type-get-font()
);
```

##### Parameters

none

##### Return Value

Returns the default font-family.

#### type-use-font()

```scss
// Import stylebox
@use '@talenra/stylebox';

body {
  // Set default font and basic global typographic settings
  @include stylebox.type-use-font();
  // font-family: cfg.$font-family;
  // font-feature-settings: 'liga' 1, 'kern' 1;
  // -webkit-font-smoothing: antialiased;
}
```

##### Parameters

none

##### Return Value

Applies the default font-family and basic global typographic settings.

#### type-use($preset, $weight, $style, $flowtext, $suppress)

```scss
// Import stylebox
@use '@talenra/stylebox';

.shortcut {
  // Use typographic preset in your stylesheet
  @include stylebox.type-use('xxs');
  // font-size: 0.625rem;
  // line-height: 0.75rem;
  // font-weight: 300;
  // letter-spacing: 0.02em;
}
```

##### Parameters

All parameters are optional

|  Param           |  Default Value | Description                                                                |
| ---------------- | -------------- | -------------------------------------------------------------------------- |
| enum `$preset`   | `m`            | Supported values: `xxs`, `xs`, `s`, `m`, `l`, `h-s`, `h-m`, `h-l`, `h-xxl` |
| enum `$weight`   | `null`         | Supported values: `light`, `regular`, `medium`                             |
| enum `$style`    | `null`         | Supported values: `normal`                                                 |
| bool `$flowtext` | `false`        | Optimize preset for flowtext (multi-line text)                             |
| list `$suppress` | `null`         | Suppress a given CSS property. Currently only supports `line-height`       |

The table below shows all supported typographic presets.

|  preset | weight                         |  style     | size   | Notes                                                            |
| ------- | ------------------------------ | ---------- | ------ | ---------------------------------------------------------------- |
| `xxs`   | `light`\*                      | `normal`\* | `10px` | Used for shortcuts only (e.g. "alt-Y")                           |
| `xs`    | `regular`\*, `light`           | `normal`\* | `12px` |
| `s`     | `medium`, `regular`\*, `light` | `normal`\* | `14px` |
| `m`\*   | `medium`, `regular`\*, `light` | `normal`\* | `16px` |
| `l`     | `medium`, `regular`\*, `light` | `normal`\* | `18px` |
| `h-s`   | `regular`\*                    | `normal`\* | `20px` |
| `h-m`   | `regular`\*                    | `normal`\* | `24px` |
| `h-l`   | `regular`\*                    | `normal`\* | `27px` | Used for app header only.                                        |
| `h-l`   | `medium`                       | `normal`\* | `28px` | Used for app header only. Weight `medium` uses bigger font-size. |
| `h-xxl` | `regular`\*                    | `normal`\* | `40px` | Used on login screen only.                                       |

\*) Default: Fallback value if param omitted (`type-use()` equals `type-use($preset: 'm', $weight: 'regular', $style: 'normal', $flowtext: false)`)

Notes:

- Preset `h-xl` is currently not available.
- Presets with prefix `h-` are mainly used for headings.

##### Return Value

Applies declarations for `font-size`, `line-height`, `font-weight`, `font-style` and `letter-spacing`.

If you need to suppress a property, add it to the map passed in parameter `$suppress`.

```scss
.button {
  // Suppress `line-height`(e.g. for buttons and one-liners)
  @include stylebox.type-use('h-l', $suppress: ('line-height'));
  // font-size: 1.6875rem;
  // font-weight: 400;
  // font-style: normal;
  // letter-spacing: 0;
}
```

If you omit a parameter, the mixin will fallback to the default value. Same with invalid parameter values. The mixin will warn you about invalid parameter values.

### Sassbox

`@talenra/stylebox` exposes the complete [sassbox](https://github.com/Pixelherz/sassbox) API.

```scss
@use '@talenra/stylebox';

.foo {
  margin-top: stylebox.px-to-rem(24);
}
```

## Contributing

Contributions welcome. Please submit a pull request.

## Versioning

We use [SemVer](http://semver.org/) for versioning.

## License

This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.

## Contact

**Talenra Workspace**   
workspace@talenra.com

---
_Source: https://npm.io/package/@talenra/stylebox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
