Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 626d09a

Browse files
committed
chore(scss): remove unused functions
1 parent fb3468f commit 626d09a

File tree

7 files changed

+0
-400
lines changed

7 files changed

+0
-400
lines changed
Binary file not shown.

examples/bootstrap/css-gridish/scss/_functions.scss

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -62,110 +62,10 @@
6262
@return maps-sort($allBreakpoints, breakpoint);
6363
}
6464

65-
@function column-string-width($string, $multiple) {
66-
@return 1rem;
67-
}
68-
69-
@function column-width($breakpoint, $first, $last, $i, $columnAmount) {
70-
$columnSize: 100 / map-get($breakpoint, columns) * $i *
71-
map-get($breakpoint, columns) / $columnAmount;
72-
$margin: 0;
73-
$type: "vw";
74-
@if map-get($breakpoint, margin) {
75-
$margin: map-get($breakpoint, margin) * 2;
76-
}
77-
@if (
78-
map-get($breakpoint, margin) != null and map-get($breakpoint, margin) != 0
79-
) {
80-
$columnSize: calc(
81-
(#{100vw} - #{$margin}) * #{round-decimal($i / $columnAmount, 3, floor)}
82-
);
83-
$type: "";
84-
}
85-
86-
@return #{$columnSize}#{$type};
87-
}
88-
8965
@function is-same-breakpoint($a, $b) {
9066
@return map-get($a, breakpoint) == map-get($b, breakpoint);
9167
}
9268

93-
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
94-
@function round-decimal($number, $digits: 0, $mode: round) {
95-
$n: 1;
96-
// $number must be a number
97-
@if type-of($number) != number {
98-
@warn "#{ $number } is not a number.";
99-
@return $number;
100-
}
101-
// $digits must be a unitless number
102-
@if type-of($digits) != number {
103-
@warn "#{ $digits } is not a number.";
104-
@return $number;
105-
} @else if not unitless($digits) {
106-
@warn "#{ $digits } has a unit.";
107-
@return $number;
108-
}
109-
@for $i from 1 through $digits {
110-
$n: $n * 10;
111-
}
112-
@if $mode == round {
113-
@return round($number * $n) / $n;
114-
} @else if $mode == ceil {
115-
@return ceil($number * $n) / $n;
116-
} @else if $mode == floor {
117-
@return floor($number * $n) / $n;
118-
} @else {
119-
@warn "#{ $mode } is undefined keyword.";
120-
@return $number;
121-
}
122-
}
123-
124-
/// String to number converter
125-
/// @author Hugo Giraudel
126-
@function string-to-number($value) {
127-
@if type-of($value) == "number" {
128-
@return $value;
129-
} @else if type-of($value) != "string" {
130-
$_: log("Value for `to-number` should be a number or a string.");
131-
}
132-
133-
$result: 0;
134-
$digits: 0;
135-
$minus: str-slice($value, 1, 1) == "-";
136-
$numbers: (
137-
"0": 0,
138-
"1": 1,
139-
"2": 2,
140-
"3": 3,
141-
"4": 4,
142-
"5": 5,
143-
"6": 6,
144-
"7": 7,
145-
"8": 8,
146-
"9": 9
147-
);
148-
149-
@for $i from if($minus, 2, 1) through str-length($value) {
150-
$character: str-slice($value, $i, $i);
151-
152-
@if not(index(map-keys($numbers), $character) or $character == ".") {
153-
@return to-length(if($minus, -$result, $result), str-slice($value, $i));
154-
}
155-
156-
@if $character == "." {
157-
$digits: 1;
158-
} @else if $digits == 0 {
159-
$result: $result * 10 + map-get($numbers, $character);
160-
} @else {
161-
$digits: $digits * 10;
162-
$result: $result + map-get($numbers, $character) / $digits;
163-
}
164-
}
165-
166-
@return if($minus, -$result, $result);
167-
}
168-
16969
/// Traverse maps and retrieve deeply nested values: https://css-tricks.com/snippets/sass/deep-getset-maps/
17070
/// @author Hugo Giraudel
17171
/// @param {Map} $map A sass map and any number of keys.
0 Bytes
Binary file not shown.

examples/carbon/css-gridish/scss/_functions.scss

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -62,110 +62,10 @@
6262
@return maps-sort($allBreakpoints, breakpoint);
6363
}
6464

65-
@function column-string-width($string, $multiple) {
66-
@return 1rem;
67-
}
68-
69-
@function column-width($breakpoint, $first, $last, $i, $columnAmount) {
70-
$columnSize: 100 / map-get($breakpoint, columns) * $i *
71-
map-get($breakpoint, columns) / $columnAmount;
72-
$margin: 0;
73-
$type: "vw";
74-
@if map-get($breakpoint, margin) {
75-
$margin: map-get($breakpoint, margin) * 2;
76-
}
77-
@if (
78-
map-get($breakpoint, margin) != null and map-get($breakpoint, margin) != 0
79-
) {
80-
$columnSize: calc(
81-
(#{100vw} - #{$margin}) * #{round-decimal($i / $columnAmount, 3, floor)}
82-
);
83-
$type: "";
84-
}
85-
86-
@return #{$columnSize}#{$type};
87-
}
88-
8965
@function is-same-breakpoint($a, $b) {
9066
@return map-get($a, breakpoint) == map-get($b, breakpoint);
9167
}
9268

93-
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
94-
@function round-decimal($number, $digits: 0, $mode: round) {
95-
$n: 1;
96-
// $number must be a number
97-
@if type-of($number) != number {
98-
@warn "#{ $number } is not a number.";
99-
@return $number;
100-
}
101-
// $digits must be a unitless number
102-
@if type-of($digits) != number {
103-
@warn "#{ $digits } is not a number.";
104-
@return $number;
105-
} @else if not unitless($digits) {
106-
@warn "#{ $digits } has a unit.";
107-
@return $number;
108-
}
109-
@for $i from 1 through $digits {
110-
$n: $n * 10;
111-
}
112-
@if $mode == round {
113-
@return round($number * $n) / $n;
114-
} @else if $mode == ceil {
115-
@return ceil($number * $n) / $n;
116-
} @else if $mode == floor {
117-
@return floor($number * $n) / $n;
118-
} @else {
119-
@warn "#{ $mode } is undefined keyword.";
120-
@return $number;
121-
}
122-
}
123-
124-
/// String to number converter
125-
/// @author Hugo Giraudel
126-
@function string-to-number($value) {
127-
@if type-of($value) == "number" {
128-
@return $value;
129-
} @else if type-of($value) != "string" {
130-
$_: log("Value for `to-number` should be a number or a string.");
131-
}
132-
133-
$result: 0;
134-
$digits: 0;
135-
$minus: str-slice($value, 1, 1) == "-";
136-
$numbers: (
137-
"0": 0,
138-
"1": 1,
139-
"2": 2,
140-
"3": 3,
141-
"4": 4,
142-
"5": 5,
143-
"6": 6,
144-
"7": 7,
145-
"8": 8,
146-
"9": 9
147-
);
148-
149-
@for $i from if($minus, 2, 1) through str-length($value) {
150-
$character: str-slice($value, $i, $i);
151-
152-
@if not(index(map-keys($numbers), $character) or $character == ".") {
153-
@return to-length(if($minus, -$result, $result), str-slice($value, $i));
154-
}
155-
156-
@if $character == "." {
157-
$digits: 1;
158-
} @else if $digits == 0 {
159-
$result: $result * 10 + map-get($numbers, $character);
160-
} @else {
161-
$digits: $digits * 10;
162-
$result: $result + map-get($numbers, $character) / $digits;
163-
}
164-
}
165-
166-
@return if($minus, -$result, $result);
167-
}
168-
16969
/// Traverse maps and retrieve deeply nested values: https://css-tricks.com/snippets/sass/deep-getset-maps/
17070
/// @author Hugo Giraudel
17171
/// @param {Map} $map A sass map and any number of keys.
Binary file not shown.

examples/material/css-gridish/scss/_functions.scss

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -62,110 +62,10 @@
6262
@return maps-sort($allBreakpoints, breakpoint);
6363
}
6464

65-
@function column-string-width($string, $multiple) {
66-
@return 1rem;
67-
}
68-
69-
@function column-width($breakpoint, $first, $last, $i, $columnAmount) {
70-
$columnSize: 100 / map-get($breakpoint, columns) * $i *
71-
map-get($breakpoint, columns) / $columnAmount;
72-
$margin: 0;
73-
$type: "vw";
74-
@if map-get($breakpoint, margin) {
75-
$margin: map-get($breakpoint, margin) * 2;
76-
}
77-
@if (
78-
map-get($breakpoint, margin) != null and map-get($breakpoint, margin) != 0
79-
) {
80-
$columnSize: calc(
81-
(#{100vw} - #{$margin}) * #{round-decimal($i / $columnAmount, 3, floor)}
82-
);
83-
$type: "";
84-
}
85-
86-
@return #{$columnSize}#{$type};
87-
}
88-
8965
@function is-same-breakpoint($a, $b) {
9066
@return map-get($a, breakpoint) == map-get($b, breakpoint);
9167
}
9268

93-
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
94-
@function round-decimal($number, $digits: 0, $mode: round) {
95-
$n: 1;
96-
// $number must be a number
97-
@if type-of($number) != number {
98-
@warn "#{ $number } is not a number.";
99-
@return $number;
100-
}
101-
// $digits must be a unitless number
102-
@if type-of($digits) != number {
103-
@warn "#{ $digits } is not a number.";
104-
@return $number;
105-
} @else if not unitless($digits) {
106-
@warn "#{ $digits } has a unit.";
107-
@return $number;
108-
}
109-
@for $i from 1 through $digits {
110-
$n: $n * 10;
111-
}
112-
@if $mode == round {
113-
@return round($number * $n) / $n;
114-
} @else if $mode == ceil {
115-
@return ceil($number * $n) / $n;
116-
} @else if $mode == floor {
117-
@return floor($number * $n) / $n;
118-
} @else {
119-
@warn "#{ $mode } is undefined keyword.";
120-
@return $number;
121-
}
122-
}
123-
124-
/// String to number converter
125-
/// @author Hugo Giraudel
126-
@function string-to-number($value) {
127-
@if type-of($value) == "number" {
128-
@return $value;
129-
} @else if type-of($value) != "string" {
130-
$_: log("Value for `to-number` should be a number or a string.");
131-
}
132-
133-
$result: 0;
134-
$digits: 0;
135-
$minus: str-slice($value, 1, 1) == "-";
136-
$numbers: (
137-
"0": 0,
138-
"1": 1,
139-
"2": 2,
140-
"3": 3,
141-
"4": 4,
142-
"5": 5,
143-
"6": 6,
144-
"7": 7,
145-
"8": 8,
146-
"9": 9
147-
);
148-
149-
@for $i from if($minus, 2, 1) through str-length($value) {
150-
$character: str-slice($value, $i, $i);
151-
152-
@if not(index(map-keys($numbers), $character) or $character == ".") {
153-
@return to-length(if($minus, -$result, $result), str-slice($value, $i));
154-
}
155-
156-
@if $character == "." {
157-
$digits: 1;
158-
} @else if $digits == 0 {
159-
$result: $result * 10 + map-get($numbers, $character);
160-
} @else {
161-
$digits: $digits * 10;
162-
$result: $result + map-get($numbers, $character) / $digits;
163-
}
164-
}
165-
166-
@return if($minus, -$result, $result);
167-
}
168-
16969
/// Traverse maps and retrieve deeply nested values: https://css-tricks.com/snippets/sass/deep-getset-maps/
17070
/// @author Hugo Giraudel
17171
/// @param {Map} $map A sass map and any number of keys.

0 commit comments

Comments
 (0)