Skip to content

Commit 5bea04d

Browse files
committed
add docs about the new atlantis function fluid-prop()
1 parent 98a53d9 commit 5bea04d

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

docs/ts-scss/atlantis/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ All available mixins:
7171

7272
All available functions:
7373

74+
- [`fluid-prop()`](library#functions/fluid/fluid-prop)
7475
- [`inline-svg()`](library#functions/svg/inline-svg)

docs/ts-scss/atlantis/library.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,40 @@ Prevents wrapping of text by displaying ellipsis instead.
313313

314314

315315
## Functions
316+
### Fluid
317+
#### `.fluid-prop()` {#functions/fluid/fluid-prop}
318+
319+
```scss
320+
@include atlantis.fluid-prop($min-vw, $max-vw, $min-value, $max-value);
321+
```
322+
323+
Returns a clamp function with calculated values, depending on the given params.
324+
325+
* `$min-vw` -> viewport at which the value starts to be fluid
326+
* `$max-vw` -> viewport at which the value ends to be fluid
327+
* `$min-value` -> value at the beginning
328+
* `$max-value` -> value at the end
329+
330+
Usage:
331+
332+
```scss
333+
.element {
334+
font-size: atlantis.fluid-prop(30rem, 140rem, 2rem, 4rem);
335+
}
336+
```
337+
338+
We recommend for multiple uses, such as font-sizes that all have the same `$min-vw` and `$max-vw` value, to build a helper function that is then used for better readability when using the function. For example:
339+
340+
```scss
341+
@function font-fluid-prop ($min-value, $max-value) {
342+
return atlantis.fluid-prop(30rem, 140rem, $min-value, $max-value);
343+
}
344+
345+
.element {
346+
font-size: font-fluid-prop(2rem, 4rem);
347+
}
348+
```
349+
316350
### SVG
317351
#### `.inline-svg()` {#functions/svg/inline-svg}
318352

0 commit comments

Comments
 (0)