Skip to content

Commit efbd58c

Browse files
committed
feat (scss): add to-number function doc
1 parent e12beb3 commit efbd58c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/scss/02-tools/_f-to-number.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
@use "sass:math";
33
@use "sass:string";
44

5+
/**
6+
* To number - convert string to number
7+
*
8+
* @author: Stackoverflow - https://stackoverflow.com/questions/47630616/scss-arithmetic-operation-with-string
9+
*
10+
* @param string $value
11+
*
12+
* Examples :
13+
* @for $i from 1 through 6 {
14+
* &[data-per-line="#{$i}"] {
15+
* .card {
16+
* width: column(to-number(#{math.div(12, $i + 1)}));
17+
* }
18+
* }
19+
* }
20+
*/
21+
522
@function to-number($value) {
623
@if type-of($value) == "number" {
724
@return $value;

0 commit comments

Comments
 (0)