@enigmatry/scss-foundation 17.0.0-preview.5.1 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/docs/modules/README.md +19 -19
- package/docs/modules/absolute-positioning.md +28 -28
- package/docs/modules/alignment.md +45 -45
- package/docs/modules/background-hover.md +18 -18
- package/docs/modules/border-radius.md +19 -19
- package/docs/modules/breakpoints.md +27 -27
- package/docs/modules/fixed-positioning.md +28 -28
- package/docs/modules/grid.md +46 -46
- package/docs/modules/row-coloring.md +23 -23
- package/docs/modules/text-hover.md +18 -18
- package/docs/modules/text-modification.md +27 -27
- package/docs/modules/visibility.md +27 -27
- package/docs/partials/README.md +14 -14
- package/docs/partials/alignment.md +15 -15
- package/docs/partials/cursor.md +13 -13
- package/docs/partials/resize.md +9 -9
- package/docs/partials/text-control.md +11 -11
- package/docs/partials/visibility.md +9 -9
- package/jest.config.js +21 -21
- package/package.json +24 -24
- package/src/modules/_index.scss +7 -7
- package/src/modules/_map.scss +53 -53
- package/src/modules/_variables.scss +11 -11
- package/src/modules/borders/_border-radius.scss +10 -10
- package/src/modules/display/_items.scss +21 -21
- package/src/modules/layout/_grid-core.scss +53 -53
- package/src/modules/layout/_grid.scss +98 -98
- package/src/modules/layout/_index.scss +1 -1
- package/src/modules/lists/_row-coloring.scss +12 -12
- package/src/modules/position/_absolute.scss +8 -8
- package/src/modules/position/_fixed.scss +8 -8
- package/src/modules/position/_index.scss +2 -2
- package/src/modules/position/_set-position.scss +24 -24
- package/src/modules/responsiveness/_breakpoints.scss +55 -55
- package/src/modules/states/_hover.scss +6 -6
- package/src/modules/states/_index.scss +1 -1
- package/src/modules/states/_visibility.scss +15 -15
- package/src/modules/text/_hover.scss +6 -6
- package/src/modules/text/_index.scss +1 -1
- package/src/modules/text/_modification.scss +29 -29
- package/src/partials/core/_index.scss +2 -2
- package/src/partials/core/fonts/_text-control.scss +10 -10
- package/src/partials/core/layouts/_alignment.scss +21 -21
- package/src/partials/core/states/_cursors.scss +10 -10
- package/src/partials/core/states/_index.scss +2 -2
- package/src/partials/core/states/_resize.scss +2 -2
- package/src/partials/core/states/_visibility.scss +2 -2
- package/tests/display/items.tests.scss +99 -99
- package/tests/layout/grid-core.tests.scss +115 -115
- package/tests/layout/grid.tests.scss +1154 -1154
- package/tests/lists/row-coloring.tests.scss +51 -51
- package/tests/position/absolute.tests.scss +67 -67
- package/tests/position/fixed.tests.scss +67 -67
- package/tests/position/set-position.tests.scss +64 -64
- package/tests/shim.test.js +13 -13
- package/tests/text/modification.tests.scss +20 -20
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
# Text-related methods
|
|
3
|
-
|
|
4
|
-
From time to time we need to prettify and alter some text in HTML. The following methods help us with that.
|
|
5
|
-
|
|
6
|
-
## Text Modification
|
|
7
|
-
|
|
8
|
-
@use scss-foundation/src/modules/text/modification as text-modification;
|
|
9
|
-
|
|
10
|
-
- Capitalizes given string.
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
text-modification.capitalize('john'); // returns John
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
- Cuts off lengthy text by adding an ellipsis at the end. Behavior heavily depends on context; it cannot be applied to
|
|
17
|
-
containers with unlimited width.
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
@include text-modification.ellipsis();
|
|
21
|
-
```
|
|
22
|
-
This mixin is short-hand for the following set of properties:
|
|
23
|
-
```
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
text-overflow: ellipsis;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
```
|
|
1
|
+
|
|
2
|
+
# Text-related methods
|
|
3
|
+
|
|
4
|
+
From time to time we need to prettify and alter some text in HTML. The following methods help us with that.
|
|
5
|
+
|
|
6
|
+
## Text Modification
|
|
7
|
+
|
|
8
|
+
@use scss-foundation/src/modules/text/modification as text-modification;
|
|
9
|
+
|
|
10
|
+
- Capitalizes given string.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
text-modification.capitalize('john'); // returns John
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- Cuts off lengthy text by adding an ellipsis at the end. Behavior heavily depends on context; it cannot be applied to
|
|
17
|
+
containers with unlimited width.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
@include text-modification.ellipsis();
|
|
21
|
+
```
|
|
22
|
+
This mixin is short-hand for the following set of properties:
|
|
23
|
+
```
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
```
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# Visibility methods
|
|
2
|
-
|
|
3
|
-
Visibility utilities for control of element visibility based on different device states.
|
|
4
|
-
|
|
5
|
-
## Visibility
|
|
6
|
-
|
|
7
|
-
@use scss-foundation/src/modules/states/visibility;
|
|
8
|
-
|
|
9
|
-
- Show on mobile. Method for controlling the visibility of the element on mobile devices.
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
@include visibility.show-on-mobile($mobile-state: block);
|
|
13
|
-
```
|
|
14
|
-
The argument is optional and defaults to block. Sets the following property:
|
|
15
|
-
```
|
|
16
|
-
display: $mobile-state;
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Show on the tablet. Method for controlling the visibility of the element on tablet devices.
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
@include visibility.show-on-tablet($tablet-state: block);
|
|
23
|
-
```
|
|
24
|
-
The argument is optional and defaults to block. Sets the following property:
|
|
25
|
-
```
|
|
26
|
-
display: $tablet-state;
|
|
27
|
-
```
|
|
1
|
+
# Visibility methods
|
|
2
|
+
|
|
3
|
+
Visibility utilities for control of element visibility based on different device states.
|
|
4
|
+
|
|
5
|
+
## Visibility
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/modules/states/visibility;
|
|
8
|
+
|
|
9
|
+
- Show on mobile. Method for controlling the visibility of the element on mobile devices.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
@include visibility.show-on-mobile($mobile-state: block);
|
|
13
|
+
```
|
|
14
|
+
The argument is optional and defaults to block. Sets the following property:
|
|
15
|
+
```
|
|
16
|
+
display: $mobile-state;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- Show on the tablet. Method for controlling the visibility of the element on tablet devices.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
@include visibility.show-on-tablet($tablet-state: block);
|
|
23
|
+
```
|
|
24
|
+
The argument is optional and defaults to block. Sets the following property:
|
|
25
|
+
```
|
|
26
|
+
display: $tablet-state;
|
|
27
|
+
```
|
package/docs/partials/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
# Helper Classes
|
|
3
|
-
|
|
4
|
-
## How to use it
|
|
5
|
-
|
|
6
|
-
Helper classes provide an effective solution for minimizing repetitive code. You can easily apply them from this library in your code base.
|
|
7
|
-
|
|
8
|
-
## What's included
|
|
9
|
-
|
|
10
|
-
- [Alignment Helper Classes](./visibility.md)
|
|
11
|
-
- [Cursor Helper Classes](./cursor.md)
|
|
12
|
-
- [Resize Helper Classes](./resize.md)
|
|
13
|
-
- [Text Control Helper Classes](./text-control.md)
|
|
14
|
-
- [Visibility Helper Classes](./visibility.md)
|
|
1
|
+
|
|
2
|
+
# Helper Classes
|
|
3
|
+
|
|
4
|
+
## How to use it
|
|
5
|
+
|
|
6
|
+
Helper classes provide an effective solution for minimizing repetitive code. You can easily apply them from this library in your code base.
|
|
7
|
+
|
|
8
|
+
## What's included
|
|
9
|
+
|
|
10
|
+
- [Alignment Helper Classes](./visibility.md)
|
|
11
|
+
- [Cursor Helper Classes](./cursor.md)
|
|
12
|
+
- [Resize Helper Classes](./resize.md)
|
|
13
|
+
- [Text Control Helper Classes](./text-control.md)
|
|
14
|
+
- [Visibility Helper Classes](./visibility.md)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Alignment Helper Classes
|
|
2
|
-
|
|
3
|
-
Provides a set of classes that can be used to apply flexible alignment properties. Included classes are: space-between, align-center, align-right, align-vertical which work using utilities for positioning items using flex.
|
|
4
|
-
|
|
5
|
-
## Alignment
|
|
6
|
-
|
|
7
|
-
@use scss-foundation/src/partials/core/layout/alignment;
|
|
8
|
-
|
|
9
|
-
- The `space-between` class applies a flexible alignment to its elements, distributing them along the horizontal axis with space between each element.
|
|
10
|
-
|
|
11
|
-
- The `align-center` class applies a flexible alignment to its elements, centering them both horizontally and vertically inside the parent container.
|
|
12
|
-
|
|
13
|
-
- The `align-right` class applies a flexible alignment to its elements, centering them vertically and aligning them to the right side of the parent container.
|
|
14
|
-
|
|
15
|
-
- The `align-vertical` class applies a flexible alignment to its elements, centering them vertically inside the parent container.
|
|
1
|
+
# Alignment Helper Classes
|
|
2
|
+
|
|
3
|
+
Provides a set of classes that can be used to apply flexible alignment properties. Included classes are: space-between, align-center, align-right, align-vertical which work using utilities for positioning items using flex.
|
|
4
|
+
|
|
5
|
+
## Alignment
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/partials/core/layout/alignment;
|
|
8
|
+
|
|
9
|
+
- The `space-between` class applies a flexible alignment to its elements, distributing them along the horizontal axis with space between each element.
|
|
10
|
+
|
|
11
|
+
- The `align-center` class applies a flexible alignment to its elements, centering them both horizontally and vertically inside the parent container.
|
|
12
|
+
|
|
13
|
+
- The `align-right` class applies a flexible alignment to its elements, centering them vertically and aligning them to the right side of the parent container.
|
|
14
|
+
|
|
15
|
+
- The `align-vertical` class applies a flexible alignment to its elements, centering them vertically inside the parent container.
|
package/docs/partials/cursor.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# Cursor Helper Classes
|
|
2
|
-
|
|
3
|
-
Various cursor states. Currently supported: clickable, draggable, and forbidden, each of them represents a specific cursor state.
|
|
4
|
-
|
|
5
|
-
## Cursor
|
|
6
|
-
|
|
7
|
-
@use scss-foundation/src/partials/core/states/cursor;
|
|
8
|
-
|
|
9
|
-
- The `clickable` class is used to indicate that an element is clickable. When this class is applied, the cursor will change to a pointer.
|
|
10
|
-
|
|
11
|
-
- The `draggable` class is used to indicate that an element is draggable. When this class is applied, the cursor will change to a grabbing hand.
|
|
12
|
-
|
|
13
|
-
- The `forbidden` class is used to indicate that an element is not allowed to be interacted with. When this class is applied, the cursor will change to not allowed.
|
|
1
|
+
# Cursor Helper Classes
|
|
2
|
+
|
|
3
|
+
Various cursor states. Currently supported: clickable, draggable, and forbidden, each of them represents a specific cursor state.
|
|
4
|
+
|
|
5
|
+
## Cursor
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/partials/core/states/cursor;
|
|
8
|
+
|
|
9
|
+
- The `clickable` class is used to indicate that an element is clickable. When this class is applied, the cursor will change to a pointer.
|
|
10
|
+
|
|
11
|
+
- The `draggable` class is used to indicate that an element is draggable. When this class is applied, the cursor will change to a grabbing hand.
|
|
12
|
+
|
|
13
|
+
- The `forbidden` class is used to indicate that an element is not allowed to be interacted with. When this class is applied, the cursor will change to not allowed.
|
package/docs/partials/resize.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Resize Helper Class
|
|
2
|
-
|
|
3
|
-
Resize helper class is used to disable the resizing behavior of an element, preventing users from resizing it.
|
|
4
|
-
|
|
5
|
-
## Resize
|
|
6
|
-
|
|
7
|
-
@use scss-foundation/src/partials/core/states/resize;
|
|
8
|
-
|
|
9
|
-
- Apply the `no-resize` class to an element to disable resizing.
|
|
1
|
+
# Resize Helper Class
|
|
2
|
+
|
|
3
|
+
Resize helper class is used to disable the resizing behavior of an element, preventing users from resizing it.
|
|
4
|
+
|
|
5
|
+
## Resize
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/partials/core/states/resize;
|
|
8
|
+
|
|
9
|
+
- Apply the `no-resize` class to an element to disable resizing.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Text Control Helper Classes
|
|
2
|
-
|
|
3
|
-
Text control helper classes are used for text transformation. Included classes are: first-letter-capitalized and capitalized.
|
|
4
|
-
|
|
5
|
-
## Text Control
|
|
6
|
-
|
|
7
|
-
@use scss-foundation/src/partials/core/fonts/text-control;
|
|
8
|
-
|
|
9
|
-
- The `first-letter-capitalized` class is used to capitalize the first letter of the element.
|
|
10
|
-
|
|
11
|
-
- The `capitalized` class is used to transform all text to uppercase.
|
|
1
|
+
# Text Control Helper Classes
|
|
2
|
+
|
|
3
|
+
Text control helper classes are used for text transformation. Included classes are: first-letter-capitalized and capitalized.
|
|
4
|
+
|
|
5
|
+
## Text Control
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/partials/core/fonts/text-control;
|
|
8
|
+
|
|
9
|
+
- The `first-letter-capitalized` class is used to capitalize the first letter of the element.
|
|
10
|
+
|
|
11
|
+
- The `capitalized` class is used to transform all text to uppercase.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Hidden Helper Class
|
|
2
|
-
|
|
3
|
-
Hidden helper class is used to hide elements by setting their display property to none, effectively removing them from the visual layout of the page.
|
|
4
|
-
|
|
5
|
-
## Hidden
|
|
6
|
-
|
|
7
|
-
@use scss-foundation/src/partials/core/states/visibility;
|
|
8
|
-
|
|
9
|
-
- To hide an element, apply the `hidden` class to it.
|
|
1
|
+
# Hidden Helper Class
|
|
2
|
+
|
|
3
|
+
Hidden helper class is used to hide elements by setting their display property to none, effectively removing them from the visual layout of the page.
|
|
4
|
+
|
|
5
|
+
## Hidden
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/partials/core/states/visibility;
|
|
8
|
+
|
|
9
|
+
- To hide an element, apply the `hidden` class to it.
|
package/jest.config.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"roots": [
|
|
3
|
-
"<rootDir>/tests/"
|
|
4
|
-
],
|
|
5
|
-
"setupFiles": [],
|
|
6
|
-
"collectCoverage": true,
|
|
7
|
-
"collectCoverageFrom": [
|
|
8
|
-
"**/*.scss"
|
|
9
|
-
],
|
|
10
|
-
"transform": {},
|
|
11
|
-
"transformIgnorePatterns": [
|
|
12
|
-
"<rootDir>/node_modules/"
|
|
13
|
-
],
|
|
14
|
-
"testMatch": ["**/tests/*.js"],
|
|
15
|
-
"testPathIgnorePatterns": [
|
|
16
|
-
"<rootDir>/node_modules/",
|
|
17
|
-
],
|
|
18
|
-
"testEnvironment": 'jest-environment-node',
|
|
19
|
-
"moduleFileExtensions": [
|
|
20
|
-
"js"
|
|
21
|
-
]
|
|
1
|
+
module.exports = {
|
|
2
|
+
"roots": [
|
|
3
|
+
"<rootDir>/tests/"
|
|
4
|
+
],
|
|
5
|
+
"setupFiles": [],
|
|
6
|
+
"collectCoverage": true,
|
|
7
|
+
"collectCoverageFrom": [
|
|
8
|
+
"**/*.scss"
|
|
9
|
+
],
|
|
10
|
+
"transform": {},
|
|
11
|
+
"transformIgnorePatterns": [
|
|
12
|
+
"<rootDir>/node_modules/"
|
|
13
|
+
],
|
|
14
|
+
"testMatch": ["**/tests/*.js"],
|
|
15
|
+
"testPathIgnorePatterns": [
|
|
16
|
+
"<rootDir>/node_modules/",
|
|
17
|
+
],
|
|
18
|
+
"testEnvironment": 'jest-environment-node',
|
|
19
|
+
"moduleFileExtensions": [
|
|
20
|
+
"js"
|
|
21
|
+
]
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@enigmatry/scss-foundation",
|
|
3
|
-
"version": "17.0.0
|
|
4
|
-
"author": "Enigmatry",
|
|
5
|
-
"description": "Collection of SCSS utilities useful for the most of projects.",
|
|
6
|
-
"homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/scss-foundation#readme",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/enigmatry/entry-angular-building-blocks.git"
|
|
10
|
-
},
|
|
11
|
-
"license": "Apache-2.0",
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "sass --style=compressed --load-path=src src/partials/main.scss dist/scss-foundation.css",
|
|
14
|
-
"build-modules": "sass --style=compressed --load-path=src --load-path=../../node_modules src/modules/_index.scss dist/scss-foundation-modules.css",
|
|
15
|
-
"lint": "stylelint --fix src/**/*.scss --config ../../.stylelintrc.json",
|
|
16
|
-
"test": "jest --coverage --colors"
|
|
17
|
-
},
|
|
18
|
-
"peerDependencies": {
|
|
19
|
-
"sass-true": "7.0.0"
|
|
20
|
-
},
|
|
21
|
-
"publishConfig": {
|
|
22
|
-
"access": "public"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@enigmatry/scss-foundation",
|
|
3
|
+
"version": "17.0.0",
|
|
4
|
+
"author": "Enigmatry",
|
|
5
|
+
"description": "Collection of SCSS utilities useful for the most of projects.",
|
|
6
|
+
"homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/scss-foundation#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/enigmatry/entry-angular-building-blocks.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "sass --style=compressed --load-path=src src/partials/main.scss dist/scss-foundation.css",
|
|
14
|
+
"build-modules": "sass --style=compressed --load-path=src --load-path=../../node_modules src/modules/_index.scss dist/scss-foundation-modules.css",
|
|
15
|
+
"lint": "stylelint --fix src/**/*.scss --config ../../.stylelintrc.json",
|
|
16
|
+
"test": "jest --coverage --colors"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"sass-true": "7.0.0"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/modules/_index.scss
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@use 'display';
|
|
2
|
-
@use 'layout';
|
|
3
|
-
@use 'position';
|
|
4
|
-
@use 'responsiveness';
|
|
5
|
-
@use 'text';
|
|
6
|
-
@use 'lists';
|
|
7
|
-
@use 'borders';
|
|
1
|
+
@use 'display';
|
|
2
|
+
@use 'layout';
|
|
3
|
+
@use 'position';
|
|
4
|
+
@use 'responsiveness';
|
|
5
|
+
@use 'text';
|
|
6
|
+
@use 'lists';
|
|
7
|
+
@use 'borders';
|
|
8
8
|
@use 'states';
|
package/src/modules/_map.scss
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:string';
|
|
3
|
-
@use 'sass:map';
|
|
4
|
-
@use 'sass:meta';
|
|
5
|
-
@use 'variables' as vars;
|
|
6
|
-
|
|
7
|
-
@function value-from($object, $path) {
|
|
8
|
-
|
|
9
|
-
@if meta.type-of($object) != map {
|
|
10
|
-
@return -error('Please provide valid object! Given value: ' + $object);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@if meta.type-of($path) != string {
|
|
14
|
-
@return -error('Please provide valid path! Given value: ' + $path);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
$keys: -split($path);
|
|
18
|
-
|
|
19
|
-
$result: $object;
|
|
20
|
-
|
|
21
|
-
@each $key in $keys {
|
|
22
|
-
@if (map.has-key($result, $key) == false) {
|
|
23
|
-
@return -error('Path segment must be any of following values: ' + map.keys($result) + '. Given path segment: ' + $key);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
$result: map.get($result, $key);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@return $result;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@function -split($string, $separator: '.') {
|
|
33
|
-
$result: ();
|
|
34
|
-
$current-index: string.index($string, $separator);
|
|
35
|
-
@while $current-index != null {
|
|
36
|
-
$key: string.slice($string, 1, $current-index - 1);
|
|
37
|
-
$result: list.append($result, $key);
|
|
38
|
-
$string: string.slice($string, $current-index + 1);
|
|
39
|
-
$current-index: string.index($string, $separator);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* stylelint-disable-next-line scss/no-duplicate-dollar-variables */
|
|
43
|
-
$result: list.append($result, $string);
|
|
44
|
-
|
|
45
|
-
@return $result;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@function -error($error-message) {
|
|
49
|
-
@if vars.$testing == true {
|
|
50
|
-
@return $error-message;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@error $error-message;
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use 'sass:meta';
|
|
5
|
+
@use 'variables' as vars;
|
|
6
|
+
|
|
7
|
+
@function value-from($object, $path) {
|
|
8
|
+
|
|
9
|
+
@if meta.type-of($object) != map {
|
|
10
|
+
@return -error('Please provide valid object! Given value: ' + $object);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@if meta.type-of($path) != string {
|
|
14
|
+
@return -error('Please provide valid path! Given value: ' + $path);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$keys: -split($path);
|
|
18
|
+
|
|
19
|
+
$result: $object;
|
|
20
|
+
|
|
21
|
+
@each $key in $keys {
|
|
22
|
+
@if (map.has-key($result, $key) == false) {
|
|
23
|
+
@return -error('Path segment must be any of following values: ' + map.keys($result) + '. Given path segment: ' + $key);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
$result: map.get($result, $key);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@return $result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@function -split($string, $separator: '.') {
|
|
33
|
+
$result: ();
|
|
34
|
+
$current-index: string.index($string, $separator);
|
|
35
|
+
@while $current-index != null {
|
|
36
|
+
$key: string.slice($string, 1, $current-index - 1);
|
|
37
|
+
$result: list.append($result, $key);
|
|
38
|
+
$string: string.slice($string, $current-index + 1);
|
|
39
|
+
$current-index: string.index($string, $separator);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* stylelint-disable-next-line scss/no-duplicate-dollar-variables */
|
|
43
|
+
$result: list.append($result, $string);
|
|
44
|
+
|
|
45
|
+
@return $result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@function -error($error-message) {
|
|
49
|
+
@if vars.$testing == true {
|
|
50
|
+
@return $error-message;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@error $error-message;
|
|
54
54
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
$testing: false !default;
|
|
2
|
-
$default-breakpoints: (
|
|
3
|
-
mobile: ( size: 576px, description: 'sm' ),
|
|
4
|
-
tablet: ( size: 768px, description: 'md' ),
|
|
5
|
-
desktop: ( size: 992px, description: 'lg'),
|
|
6
|
-
largeDesktop: ( size: 1200px, description: 'xl'),
|
|
7
|
-
extraLargeDesktop: ( size: 1400px, description: 'xxl'));
|
|
8
|
-
|
|
9
|
-
$custom-breakpoints: (
|
|
10
|
-
mobile: ( size: 540px, description: 'sm' ),
|
|
11
|
-
tablet: ( size: 800px, description: 'md' ),
|
|
1
|
+
$testing: false !default;
|
|
2
|
+
$default-breakpoints: (
|
|
3
|
+
mobile: ( size: 576px, description: 'sm' ),
|
|
4
|
+
tablet: ( size: 768px, description: 'md' ),
|
|
5
|
+
desktop: ( size: 992px, description: 'lg'),
|
|
6
|
+
largeDesktop: ( size: 1200px, description: 'xl'),
|
|
7
|
+
extraLargeDesktop: ( size: 1400px, description: 'xxl'));
|
|
8
|
+
|
|
9
|
+
$custom-breakpoints: (
|
|
10
|
+
mobile: ( size: 540px, description: 'sm' ),
|
|
11
|
+
tablet: ( size: 800px, description: 'md' ),
|
|
12
12
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
@mixin partial-border-radius($top-left: 0, $top-right: 0, $bottom-right: 0, $bottom-left: 0) {
|
|
2
|
-
border: {
|
|
3
|
-
/* stylelint-disable scss/declaration-nested-properties */
|
|
4
|
-
top-left-radius: $top-left;
|
|
5
|
-
top-right-radius: $top-right;
|
|
6
|
-
bottom-right-radius: $bottom-right;
|
|
7
|
-
bottom-left-radius: $bottom-left;
|
|
8
|
-
/* stylelint-enable scss/declaration-nested-properties */
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
@mixin partial-border-radius($top-left: 0, $top-right: 0, $bottom-right: 0, $bottom-left: 0) {
|
|
2
|
+
border: {
|
|
3
|
+
/* stylelint-disable scss/declaration-nested-properties */
|
|
4
|
+
top-left-radius: $top-left;
|
|
5
|
+
top-right-radius: $top-right;
|
|
6
|
+
bottom-right-radius: $bottom-right;
|
|
7
|
+
bottom-left-radius: $bottom-left;
|
|
8
|
+
/* stylelint-enable scss/declaration-nested-properties */
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
@mixin align-center() {
|
|
2
|
-
@include fully-align(center);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
@mixin align($align) {
|
|
6
|
-
@include fully-align($align);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@mixin align-absolute-center() {
|
|
11
|
-
@include fully-align(center, center);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@mixin fully-align($align, $justify: flex-start, $direction: row, $wrap: wrap) {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex: {
|
|
17
|
-
direction: $direction;
|
|
18
|
-
wrap: $wrap;
|
|
19
|
-
};
|
|
20
|
-
align-items: $align;
|
|
21
|
-
justify-content: $justify;
|
|
1
|
+
@mixin align-center() {
|
|
2
|
+
@include fully-align(center);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin align($align) {
|
|
6
|
+
@include fully-align($align);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@mixin align-absolute-center() {
|
|
11
|
+
@include fully-align(center, center);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@mixin fully-align($align, $justify: flex-start, $direction: row, $wrap: wrap) {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex: {
|
|
17
|
+
direction: $direction;
|
|
18
|
+
wrap: $wrap;
|
|
19
|
+
};
|
|
20
|
+
align-items: $align;
|
|
21
|
+
justify-content: $justify;
|
|
22
22
|
}
|