@enigmatry/scss-foundation 1.15.1-preview.9 → 15.0.0-preview
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 +3 -11
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/dist/scss-foundation-modules.css +1 -0
- package/dist/scss-foundation-modules.css.map +1 -0
- package/dist/scss-foundation.css +1 -1
- package/dist/scss-foundation.css.map +1 -1
- package/docs/modules/README.md +19 -0
- package/docs/{absolute-positioning.md → modules/absolute-positioning.md} +5 -3
- package/docs/{alignment.md → modules/alignment.md} +13 -6
- package/docs/modules/background-hover.md +18 -0
- package/docs/modules/border-radius.md +20 -0
- package/docs/modules/breakpoints.md +27 -0
- package/docs/{fixed-positioning.md → modules/fixed-positioning.md} +5 -3
- package/docs/modules/grid.md +46 -0
- package/docs/modules/row-coloring.md +24 -0
- package/docs/modules/text-hover.md +18 -0
- package/docs/modules/text-modification.md +27 -0
- package/docs/modules/visibility.md +27 -0
- package/docs/partials/README.md +14 -0
- package/docs/partials/alignment.md +15 -0
- package/docs/partials/cursor.md +13 -0
- package/docs/partials/resize.md +9 -0
- package/docs/partials/text-control.md +11 -0
- package/docs/partials/visibility.md +9 -0
- package/package.json +2 -2
- package/src/modules/layout/_grid-core.scss +2 -1
- package/src/modules/layout/_grid.scss +2 -2
- package/src/modules/states/_hover.scss +7 -0
- package/src/modules/states/_index.scss +1 -0
- package/src/modules/text/_modification.scss +1 -1
- package/src/partials/core/layouts/_alignment.scss +4 -0
- package/tests/display/items.tests.scss +1 -1
- package/tests/layout/grid-core.tests.scss +3 -1
- package/tests/layout/grid.tests.scss +3 -1
- package/tests/lists/row-coloring.tests.scss +1 -1
- package/tests/position/absolute.tests.scss +1 -1
- package/tests/position/fixed.tests.scss +1 -1
- package/tests/position/set-position.tests.scss +1 -1
- package/tests/shim.test.js +2 -2
- package/tests/text/modification.tests.scss +1 -1
- package/docs/breakpoints.md +0 -23
- package/docs/grid.md +0 -40
- package/docs/text-modification.md +0 -24
- package/src/partials/states/_cursors.scss +0 -11
- package/src/partials/states/_index.scss +0 -3
- package/src/partials/states/_resize.scss +0 -3
- package/src/partials/states/_visibility.scss +0 -3
package/README.md
CHANGED
|
@@ -7,19 +7,11 @@
|
|
|
7
7
|
$ npm install --save-dev @enigmatry/scss-foundation
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
## How to use it
|
|
11
|
-
|
|
12
|
-
Utilities are nothing more than just sass mixins that won't be included in your code base unless you @use individual file of this library and @include them.
|
|
13
|
-
|
|
14
|
-
|
|
15
10
|
## What's included
|
|
16
11
|
|
|
17
|
-
- [
|
|
18
|
-
|
|
19
|
-
- [
|
|
20
|
-
- [Absolute Positioning utilities](../scss-foundation/docs/absolute-positioning.md)
|
|
21
|
-
- [Fixed Positioning utilities](../scss-foundation/docs/fixed-positioning.md)
|
|
22
|
-
- [Text Modification utilities](../scss-foundation/docs/text-modification.md)
|
|
12
|
+
- [Utilities](../scss-foundation/docs/modules/README.md)
|
|
13
|
+
|
|
14
|
+
- [Helper Classes](../scss-foundation/docs/partials/README.md)
|
|
23
15
|
|
|
24
16
|
## License
|
|
25
17
|
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1699000683047" clover="3.2.0">
|
|
3
|
+
<project timestamp="1699000683047" name="All files">
|
|
4
4
|
<metrics statements="0" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0" elements="0" coveredelements="0" complexity="0" loc="0" ncloc="0" packages="0" files="0" classes="0"/>
|
|
5
5
|
</project>
|
|
6
6
|
</coverage>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
87
87
|
Code coverage generated by
|
|
88
88
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
89
|
-
at 2023-
|
|
89
|
+
at 2023-11-03T08:38:03.044Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*# sourceMappingURL=scss-foundation-modules.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":[],"names":[],"mappings":"","file":"scss-foundation-modules.css"}
|
package/dist/scss-foundation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.first-letter-capitalized{display:inline-block}.first-letter-capitalized::first-letter{text-transform:capitalize}.capitalized{text-transform:uppercase}.space-between{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between}.align-center{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:center}.align-right{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-end}.align-vertical{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start}.clickable{cursor:pointer}.draggable{cursor:grab}.forbidden{cursor:not-allowed}.hidden{display:none}.no-resize{resize:none}/*# sourceMappingURL=scss-foundation.css.map */
|
|
1
|
+
.first-letter-capitalized{display:inline-block}.first-letter-capitalized::first-letter{text-transform:capitalize}.capitalized{text-transform:uppercase}.space-between{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between}.align-center{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:center}.align-right{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-end}.align-vertical{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start}.stack-vertical{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:baseline;justify-content:space-between}.clickable{cursor:pointer}.draggable{cursor:grab}.forbidden{cursor:not-allowed}.hidden{display:none}.no-resize{resize:none}/*# sourceMappingURL=scss-foundation.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/partials/core/fonts/_text-control.scss","../src/partials/core/layouts/_alignment.scss","../src/modules/display/_items.scss","../src/partials/core/states/_cursors.scss","../src/partials/core/states/_visibility.scss","../src/partials/core/states/_resize.scss"],"names":[],"mappings":"AAAA,0BACC,qBAEA,wCACC,0BAIF,aACC,yBCPD,eCYC,aAEC,eAH2D,IAI3D,UAJuE,KAMxE,YDhB2B,OCiB3B,gBDjBmC,cAGpC,cCQC,aAEC,eAH2D,IAI3D,UAJuE,KAMxE,YATqB,OAUrB,gBAV6B,oBAI7B,aAEC,eAH2D,IAI3D,UAJuE,KAMxE,YDR2B,OCS3B,gBDTmC,SAGpC,6BCEE,eAH2D,IAI3D,UAJuE,KAMxE,YDJqB,OCKrB,gBAPoC,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/partials/core/fonts/_text-control.scss","../src/partials/core/layouts/_alignment.scss","../src/modules/display/_items.scss","../src/partials/core/states/_cursors.scss","../src/partials/core/states/_visibility.scss","../src/partials/core/states/_resize.scss"],"names":[],"mappings":"AAAA,0BACC,qBAEA,wCACC,0BAIF,aACC,yBCPD,eCYC,aAEC,eAH2D,IAI3D,UAJuE,KAMxE,YDhB2B,OCiB3B,gBDjBmC,cAGpC,cCQC,aAEC,eAH2D,IAI3D,UAJuE,KAMxE,YATqB,OAUrB,gBAV6B,oBAI7B,aAEC,eAH2D,IAI3D,UAJuE,KAMxE,YDR2B,OCS3B,gBDTmC,SAGpC,6BCEE,eAH2D,IAI3D,UAJuE,KAMxE,YDJqB,OCKrB,gBAPoC,WDKrC,gBCJC,aAEC,eDGmD,OCFnD,UDE2D,4BCC5D,gBDDqC,cEnBtC,WACC,eAGD,WACC,YAGD,WACC,mBCTD,QACC,aCDD,WACC","file":"scss-foundation.css"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Utilities
|
|
2
|
+
|
|
3
|
+
## How to use it
|
|
4
|
+
|
|
5
|
+
Utilities are nothing more than just sass mixins that won't be included in your code base unless you @use individual files of this library and @include them.
|
|
6
|
+
|
|
7
|
+
## What's included
|
|
8
|
+
|
|
9
|
+
- [Flexible Grid System](./grid.md)
|
|
10
|
+
- [Encapsulated logic regarding Breakpoints / Media queries](./breakpoints.md)
|
|
11
|
+
- [(Flex) Alignment utilities](./alignment.md)
|
|
12
|
+
- [Background Hover utilities](./background-hover.md)
|
|
13
|
+
- [Absolute Positioning utilities](./absolute-positioning.md)
|
|
14
|
+
- [Fixed Positioning utilities](./fixed-positioning.md)
|
|
15
|
+
- [Text Modification utilities](./text-modification.md)
|
|
16
|
+
- [Text Hover utilities](./text-hover.md)
|
|
17
|
+
- [Border Radius utilities](./border-radius.md)
|
|
18
|
+
- [Row Coloring utilities](./row-coloring.md)
|
|
19
|
+
- [Visibility utilities](./visibility.md)
|
|
@@ -4,13 +4,14 @@ Alignment utilities for absolute positioning of content.
|
|
|
4
4
|
|
|
5
5
|
## Absolute
|
|
6
6
|
|
|
7
|
-
@use scss-foundation/src/position/absolute;
|
|
7
|
+
@use scss-foundation/src/modules/position/absolute;
|
|
8
8
|
|
|
9
9
|
- Replaces the several most common lines in absolute positioning with just one liner.
|
|
10
|
+
|
|
10
11
|
```
|
|
11
12
|
@include absolute.position($top, $right, $bottom, $left);
|
|
12
13
|
```
|
|
13
|
-
All arguments are optional and default to 0. Sets following properties:
|
|
14
|
+
All arguments are optional and default to 0. Sets the following properties:
|
|
14
15
|
```
|
|
15
16
|
position: absolute;
|
|
16
17
|
top: $top;
|
|
@@ -20,7 +21,8 @@ All arguments are optional and default to 0. Sets following properties:
|
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
- Replaces the several most common lines in absolute positioning for unset values with just one liner.
|
|
24
|
+
|
|
23
25
|
```
|
|
24
26
|
@include absolute.position-unset($top, $right, $bottom, $left);
|
|
25
27
|
```
|
|
26
|
-
All arguments are optional and default to unset. Sets the same properties as in previous method.
|
|
28
|
+
All arguments are optional and default to unset. Sets the same properties as in the previous method.
|
|
@@ -4,27 +4,36 @@ Alignment utilities for positioning items using flex.
|
|
|
4
4
|
|
|
5
5
|
## Items
|
|
6
6
|
|
|
7
|
-
@use scss-foundation/src/display/items;
|
|
7
|
+
@use scss-foundation/src/modules/display/items;
|
|
8
|
+
|
|
9
|
+
- Center alignment. Wrapper method for following flex settings: flex direction row, justify content on flex start and
|
|
10
|
+
align items centrally.
|
|
8
11
|
|
|
9
|
-
- Center alignment. Wrapper method for following flex settings: flex direction row, justify content on flex start and align items centrally.
|
|
10
12
|
```
|
|
11
13
|
@include items.align-center();
|
|
12
14
|
```
|
|
15
|
+
|
|
13
16
|
- Configurable alignment. Everything is same as for the previous method, but align items property is configurable.
|
|
17
|
+
|
|
14
18
|
```
|
|
15
19
|
@include items.align($align);
|
|
16
20
|
```
|
|
21
|
+
|
|
17
22
|
- Horizontal and vertical central alignment. Wrapper method for following flex settings: flex direction row, justify content centrally and align items centrally.
|
|
23
|
+
|
|
18
24
|
```
|
|
19
25
|
@include items.align-absolute-center();
|
|
20
26
|
```
|
|
21
|
-
|
|
27
|
+
|
|
28
|
+
- Alignment utility. Replaces several line of CSS with just one liner.
|
|
29
|
+
|
|
22
30
|
```
|
|
23
31
|
@include items.fully-align($align, $justify, $direction, $wrap);
|
|
24
32
|
```
|
|
33
|
+
|
|
25
34
|
Optional arguments and their default values:
|
|
26
35
|
$justify: flex-start, $direction: row, $wrap: wrap
|
|
27
|
-
Sets following properties:
|
|
36
|
+
Sets the following properties:
|
|
28
37
|
```
|
|
29
38
|
display: flex;
|
|
30
39
|
flex: {
|
|
@@ -34,5 +43,3 @@ Sets following properties:
|
|
|
34
43
|
align-items: $align;
|
|
35
44
|
justify-content: $justify;
|
|
36
45
|
```
|
|
37
|
-
|
|
38
|
-
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Background hover method
|
|
2
|
+
|
|
3
|
+
Hover utilities for easy definition of regular and hover background states.
|
|
4
|
+
|
|
5
|
+
## Background hover
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/modules/states/hover;
|
|
8
|
+
|
|
9
|
+
- Background hover. Method for setting the background color of any element for the regular state, and when the element is hovered over, it changes the color to the specified hover state.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
@include hover.background-hover($regular-state, $hover-state);
|
|
13
|
+
```
|
|
14
|
+
Sets the properties for both regular and hover states:
|
|
15
|
+
```
|
|
16
|
+
background-color: $regular-state;
|
|
17
|
+
background-color: $hover-state;
|
|
18
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Border-radius method
|
|
2
|
+
|
|
3
|
+
Border radius utility for setting different border radius values for each corner of an element.
|
|
4
|
+
|
|
5
|
+
## Border Radius
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/modules/borders/border-radius;
|
|
8
|
+
|
|
9
|
+
- Replaces the several most common lines in border radius with just one liner.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
@include border-radius.partial-border-radius($top-left, $top-right, $bottom-right, $bottom-left);
|
|
13
|
+
```
|
|
14
|
+
All arguments are optional and default to 0. Sets the following properties:
|
|
15
|
+
```
|
|
16
|
+
top-left-radius: $top-left;
|
|
17
|
+
top-right-radius: $top-right;
|
|
18
|
+
bottom-right-radius: $bottom-right;
|
|
19
|
+
bottom-left-radius: $bottom-left;
|
|
20
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Breakpoints methods
|
|
2
|
+
|
|
3
|
+
Utilities related to the application's breakpoints.
|
|
4
|
+
|
|
5
|
+
## Breakpoints
|
|
6
|
+
|
|
7
|
+
This module has an overridable breakpoints variable. Due to Sass limitations, there should be only one (wrapper) @use/@forward of this utility in your application in order to prevent side effects and to have easier work.
|
|
8
|
+
Breakpoints must be in the same format as variables inside the src root folder.
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
@use scss-foundation/src/modules/responsiveness/breakpoints;
|
|
12
|
+
|
|
13
|
+
- Applies desired styles and properties starting from a certain breakpoint given by its key. The key must be a valid key from
|
|
14
|
+
the given (or default) breakpoint collection.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
@include breakpoints.apply-on($given-size);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- Sets up breakpoints in a way so you can pass them to the JS from HTML. This is needed so you could have them defined
|
|
21
|
+
only in SCSS after which you can apply some logic in JS based on that, but with only one spot for future maintenance.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
@include breakpoints.set-up($with-capitalization);
|
|
25
|
+
```
|
|
26
|
+
Mixin defines the set of properties that must be added to a certain HTML container, ideally the root one. Whatever the width of the display device is, the content property of it is gonna hold a descriptive name for it and you can process that kind of enum insided JS and apply some logic.
|
|
27
|
+
$with-capitalization argument is optional (default = true), since we're mostly using TypeScript + Angular Material which enforces capitalization.
|
|
@@ -4,13 +4,14 @@ Alignment utilities for fixed positioning of content.
|
|
|
4
4
|
|
|
5
5
|
## Fixed
|
|
6
6
|
|
|
7
|
-
@use scss-foundation/src/position/fixed;
|
|
7
|
+
@use scss-foundation/src/modules/position/fixed;
|
|
8
8
|
|
|
9
9
|
- Replaces the several most common lines in fixed positioning with just one liner.
|
|
10
|
+
|
|
10
11
|
```
|
|
11
12
|
@include fixed.position($top, $right, $bottom, $left);
|
|
12
13
|
```
|
|
13
|
-
All arguments are optional and default to 0. Sets following properties:
|
|
14
|
+
All arguments are optional and default to 0. Sets the following properties:
|
|
14
15
|
```
|
|
15
16
|
position: fixed;
|
|
16
17
|
top: $top;
|
|
@@ -20,7 +21,8 @@ All arguments are optional and default to 0. Sets following properties:
|
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
- Replaces the several most common lines in fixed positioning for unset values with just one liner.
|
|
24
|
+
|
|
23
25
|
```
|
|
24
26
|
@include fixed.position-unset($top, $right, $bottom, $left);
|
|
25
27
|
```
|
|
26
|
-
All arguments are optional and default to unset. Sets the same properties as in previous method.
|
|
28
|
+
All arguments are optional and default to unset. Sets the same properties as in the previous method.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
# Grid methods
|
|
3
|
+
|
|
4
|
+
Grid heavily depends on breakpoints utilities since there's not much sense in making a grid without them. On the other hand, on rare occasions, if you just need row styles with auto width, independent core grid utilities might be just enough. In the majority of cases, this utility is already the part of full grid so there's no need to use it manually.
|
|
5
|
+
|
|
6
|
+
## Grid
|
|
7
|
+
|
|
8
|
+
This module has an overridable breakpoints variable. Due to Sass limitations, there should be only one (wrapper) @use/@forward of this utility in your application in order to prevent side effects and to have easier work.
|
|
9
|
+
Breakpoints must be in the same format as variables inside the src root folder.
|
|
10
|
+
|
|
11
|
+
@use scss-foundation/src/layout/grid;
|
|
12
|
+
|
|
13
|
+
- Full grid generation. It generates everything from the core grid plus all column/offset classes using syntax from Bootstrap
|
|
14
|
+
5, classes like col-sm-4, offset-md-10.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
@include grid.generate(); // or @include grid.generate($divisions);
|
|
18
|
+
```
|
|
19
|
+
The default grid (as in Bootstrap) has 12 columns, but you can change that by passing a positive number parameter (between 2 and 1000).
|
|
20
|
+
|
|
21
|
+
## Grid core
|
|
22
|
+
|
|
23
|
+
@use scss-foundation/src/layout/grid-core as grid;
|
|
24
|
+
|
|
25
|
+
- Core generation creates styles for rows and auto width of the content. You must pass prefixes for column and offset class
|
|
26
|
+
names.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
@include grid.generate($column-prefix, $offset-prefix);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- Reverse row generation. Integrated into the full grid, but this can be also added independently if needed in your application.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
@include grid.generate-reverse-row($breakpoints);
|
|
36
|
+
```
|
|
37
|
+
Breakpoints are required parameter. Expected format of breakpoints is a map/dictionary with keys being unique and something descriptive to you (i.e. mobile) and value being an object defined with size (in pixels) and string description that will be seen in CSS output (i.e. sm).
|
|
38
|
+
In other words:
|
|
39
|
+
**mobile: ( size: 576px, description: 'sm' )**
|
|
40
|
+
For more details, please check the format of the breakpoint variable inside the src root folder.
|
|
41
|
+
|
|
42
|
+
This method generates classes which helps you reverse order in row; i.e. if row had divs A, B, C and you apply reverse row class, the order will be C, B, A. There are two options:
|
|
43
|
+
|
|
44
|
+
1) .reverse-row-DESIRED_BREAKPOINT_DESCRIPTION
|
|
45
|
+
2) .reverse-dow-under-DESIRED_BREAKPOINT_DESCRIPTION
|
|
46
|
+
The first one helps you to reverse order starting from a given breakpoint (DESIRED_BREAKPOINT_DESCRIPTION might be sm, md, xxl, depending on what you pass as a breakpoint description). The second one helps you to reverse order on all widths under certain breakpoint.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Row coloring methods
|
|
2
|
+
|
|
3
|
+
Row coloring utilities for the background color to rows based on their position.
|
|
4
|
+
|
|
5
|
+
## Row coloring
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/modules/lists/row-coloring as list;
|
|
8
|
+
|
|
9
|
+
- Odd row coloring. Method for easily applying specified background color to odd-numbered rows.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
@include list.odd-row-coloring($color);
|
|
13
|
+
```
|
|
14
|
+
Sets the following property:
|
|
15
|
+
```
|
|
16
|
+
background-color: $color;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- Even row coloring. Method for easily applying specified background color to even-numbered rows.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
@include list.even-row-coloring($color);
|
|
23
|
+
```
|
|
24
|
+
Sets the same property as in the previous method.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Text hover method
|
|
2
|
+
|
|
3
|
+
Hover utilities for easy definition of regular and hover font states.
|
|
4
|
+
|
|
5
|
+
## Text Hover
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/modules/text/hover;
|
|
8
|
+
|
|
9
|
+
- Font hover. Method for setting the color of the font for the regular state, and when the element is hovered over, it changes the color to the specified hover state.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
@include hover.font-hover($regular-state, $hover-state);
|
|
13
|
+
```
|
|
14
|
+
Sets the properties for both regular and hover states:
|
|
15
|
+
```
|
|
16
|
+
color: $regular-state;
|
|
17
|
+
color: $hover-state;
|
|
18
|
+
```
|
|
@@ -0,0 +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
|
+
```
|
|
@@ -0,0 +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
|
+
```
|
|
@@ -0,0 +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)
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +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.
|
|
@@ -0,0 +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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmatry/scss-foundation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-preview",
|
|
4
4
|
"author": "Enigmatry",
|
|
5
5
|
"description": "Collection of SCSS utilities useful for the most of projects.",
|
|
6
6
|
"homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/scss-foundation#readme",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"scripts": {
|
|
13
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 src/modules/_index.scss dist/scss-foundation-modules.css",
|
|
14
|
+
"build-modules": "sass --style=compressed --load-path=src --load-path=../../node_modules src/modules/_index.scss dist/scss-foundation-modules.css",
|
|
15
15
|
"lint": "stylelint --fix src/**/*.scss",
|
|
16
16
|
"test": "jest --coverage --colors"
|
|
17
17
|
},
|
|
@@ -12,6 +12,7 @@ $breakpoints: () !default;
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
[class ^= #{$column-prefix}], [class ^= #{$offset-prefix}] {
|
|
15
|
+
box-sizing: border-box;
|
|
15
16
|
flex-shrink: 0;
|
|
16
17
|
max-width: 100%;
|
|
17
18
|
padding: 0 $spacing;
|
|
@@ -44,7 +45,7 @@ $breakpoints: () !default;
|
|
|
44
45
|
|
|
45
46
|
#{$reverse-prefix + $under + $size} {
|
|
46
47
|
flex-direction: row-reverse;
|
|
47
|
-
|
|
48
|
+
|
|
48
49
|
@include breakpoints.apply-on($item) {
|
|
49
50
|
flex-direction: row;
|
|
50
51
|
}
|
|
@@ -4,8 +4,8 @@ $breakpoints: () !default;
|
|
|
4
4
|
@use 'sass:map';
|
|
5
5
|
@use 'sass:math';
|
|
6
6
|
@use 'sass:meta';
|
|
7
|
-
@use '
|
|
8
|
-
@use '
|
|
7
|
+
@use 'sass-true';
|
|
8
|
+
@use 'sass-true/sass/throw';
|
|
9
9
|
@use '../../modules/variables' as vars;
|
|
10
10
|
@forward '../../modules/responsiveness/breakpoints' with (
|
|
11
11
|
$breakpoints: $breakpoints
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/* stylelint-disable at-rule-allowed-list */
|
|
6
6
|
$custom-breakpoints: () !default;
|
|
7
7
|
|
|
8
|
-
@use '
|
|
8
|
+
@use 'sass-true/sass/true';
|
|
9
9
|
@use '../../src/modules/variables' as vars;
|
|
10
10
|
|
|
11
11
|
@forward '../../src/modules/layout/grid' with (
|
|
@@ -28,6 +28,7 @@ $custom-breakpoints: () !default;
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.row [class ^= 'col-'], .row [class ^= 'offset-'] {
|
|
31
|
+
box-sizing: border-box;
|
|
31
32
|
flex-shrink: 0;
|
|
32
33
|
max-width: 100%;
|
|
33
34
|
padding: 0 0;
|
|
@@ -58,6 +59,7 @@ $custom-breakpoints: () !default;
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.row [class ^= 'column-'], .row [class ^= 'gap-'] {
|
|
62
|
+
box-sizing: border-box;
|
|
61
63
|
flex-shrink: 0;
|
|
62
64
|
max-width: 100%;
|
|
63
65
|
padding: 0 8px;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/* stylelint-disable at-rule-allowed-list */
|
|
8
8
|
@use '../../src/modules/layout/grid';
|
|
9
9
|
@use '../../src/modules/variables' as vars;
|
|
10
|
-
@use '
|
|
10
|
+
@use 'sass-true';
|
|
11
11
|
|
|
12
12
|
vars.$testing: true;
|
|
13
13
|
|
|
@@ -128,6 +128,7 @@ vars.$testing: true;
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
.row [class ^= 'col-'], .row [class ^= 'offset-'] {
|
|
131
|
+
box-sizing: border-box;
|
|
131
132
|
flex-shrink: 0;
|
|
132
133
|
max-width: 100%;
|
|
133
134
|
padding: 0 0;
|
|
@@ -925,6 +926,7 @@ vars.$testing: true;
|
|
|
925
926
|
margin: 0 -8px;
|
|
926
927
|
|
|
927
928
|
[class ^= 'col-'], [class ^= 'offset-'] {
|
|
929
|
+
box-sizing: border-box;
|
|
928
930
|
flex-shrink: 0;
|
|
929
931
|
max-width: 100%;
|
|
930
932
|
padding: 0 8px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* stylelint-disable declaration-block-no-redundant-longhand-properties */
|
|
2
2
|
/* stylelint-disable shorthand-property-no-redundant-values */
|
|
3
|
-
@use '
|
|
3
|
+
@use 'sass-true/sass/true';
|
|
4
4
|
@use '../../src/modules/position/absolute';
|
|
5
5
|
|
|
6
6
|
@include true.describe('position($top, $right, $bottom, $left)') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* stylelint-disable declaration-block-no-redundant-longhand-properties */
|
|
2
2
|
/* stylelint-disable shorthand-property-no-redundant-values */
|
|
3
|
-
@use '
|
|
3
|
+
@use 'sass-true/sass/true';
|
|
4
4
|
@use '../../src/modules/position/fixed';
|
|
5
5
|
|
|
6
6
|
@include true.describe('position($top, $right, $bottom, $left)') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* stylelint-disable declaration-block-no-redundant-longhand-properties */
|
|
2
|
-
@use '
|
|
2
|
+
@use 'sass-true/sass/true';
|
|
3
3
|
@use '../../src/modules/position/set-position' as position;
|
|
4
4
|
|
|
5
5
|
@include true.describe('set-position($top, $right, $bottom, $left, $position)') {
|
package/tests/shim.test.js
CHANGED
|
@@ -7,8 +7,8 @@ const sassTrue = require('sass-true');
|
|
|
7
7
|
const glob = require('glob');
|
|
8
8
|
|
|
9
9
|
describe('Scss unit tests', () => {
|
|
10
|
-
const paths = path.resolve(process.cwd(), 'tests/**/*.tests.scss');
|
|
10
|
+
const paths = path.resolve(process.cwd(), 'tests/**/*.tests.scss').replace(/\\/g,'/');
|
|
11
11
|
const sassTestFiles = glob.sync(paths);
|
|
12
12
|
|
|
13
|
-
sassTestFiles.forEach(file => sassTrue.runSass({ describe, it }, file));
|
|
13
|
+
sassTestFiles.forEach(file => sassTrue.runSass({ describe, it }, file, {loadPaths: ['../../node_modules'] }));
|
|
14
14
|
});
|
package/docs/breakpoints.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Breakpoints methods
|
|
2
|
-
|
|
3
|
-
Utilities related with application's breakpoints.
|
|
4
|
-
|
|
5
|
-
## Breakpoints
|
|
6
|
-
|
|
7
|
-
This module has overridable breakpoints variable. Due to Sass limitations, there should be only one (wrapper) @use/@forward of this utility in your application in order to prevent side effects and to have easier work.
|
|
8
|
-
Breakpoints must be in the same format as variables inside src root folder.
|
|
9
|
-
|
|
10
|
-
Usage:
|
|
11
|
-
@use scss-foundation/src/responsiveness/breakpoints;
|
|
12
|
-
|
|
13
|
-
- Applies desired styles and properties starting from certain breakpoint given by its key. Key must be valid key from given (or default) breakpoint collection.
|
|
14
|
-
```
|
|
15
|
-
@include breakpoints.apply-on($given-size);
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
- Sets up breakpoints in a way so you can pass them to the JS from HTML. This is needed so you could have them defined only in SCSS after which you can apply some logic in JS based on that, but with only one spot for future maintenance.
|
|
19
|
-
```
|
|
20
|
-
@include breakpoints.set-up($with-capitalization);
|
|
21
|
-
```
|
|
22
|
-
Mixin defines set of properties that must be added to a certain HTML container, ideally the root one. Whatever the width of display device is, content property of it is gonna hold descriptive name for it and you can process that kind of enum insided JS and apply some logic.
|
|
23
|
-
$with-capitalization argument is optional (default = true), since we're mostly using TypeScript + Angular Material which enforces capitalization.
|
package/docs/grid.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Grid methods
|
|
3
|
-
|
|
4
|
-
Grid heavily depends on breakpoints utilities since there's not much sense in making grid without them. On the other hand, in rare occasions if you just need row styles with auto width, independent core grid utilities might be just enough. In majority of cases, this utility is already the part of full grid so there's no need to use it manually.
|
|
5
|
-
|
|
6
|
-
## Grid
|
|
7
|
-
|
|
8
|
-
This module has overridable breakpoints variable. Due to Sass limitations, there should be only one (wrapper) @use/@forward of this utility in your application in order to prevent side effects and to have easier work.
|
|
9
|
-
Breakpoints must be in the same format as variables inside src root folder.
|
|
10
|
-
|
|
11
|
-
@use scss-foundation/src/layout/grid;
|
|
12
|
-
|
|
13
|
-
- Full grid generation. It generates everything from core grid plus all column/offset classes using syntax from Bootstrap 5, classes like col-sm-4, offset-md-10.
|
|
14
|
-
```
|
|
15
|
-
@include grid.generate(); // or @include grid.generate($divisions);
|
|
16
|
-
```
|
|
17
|
-
Default grid (as in Bootstrap) has 12 columns, but you can change that by passing a positive number parameter (between 2 and 1000).
|
|
18
|
-
|
|
19
|
-
## Grid core
|
|
20
|
-
|
|
21
|
-
@use scss-foundation/src/layout/grid-core as grid;
|
|
22
|
-
|
|
23
|
-
- Core generation creates styles for rows and auto width of content. You must pass prefixes for column and offset class names.
|
|
24
|
-
```
|
|
25
|
-
@include grid.generate($column-prefix, $offset-prefix);
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
- Reverse row generation. Integrated in full grid, but this can be also added independently if needed in your application.
|
|
29
|
-
```
|
|
30
|
-
@include grid.generate-reverse-row($breakpoints);
|
|
31
|
-
```
|
|
32
|
-
Breakpoints are required parameter. Expected format of breakpoints is a map/dictionary with keys being unique and something descriptive to you (i.e. mobile) and value being an object defined with size (in pixels) and string description that will be seen in CSS output (i.e. sm).
|
|
33
|
-
In other words:
|
|
34
|
-
**mobile: ( size: 576px, description: 'sm' )**
|
|
35
|
-
For more details, please check the format of breakpoint variable inside src root folder.
|
|
36
|
-
|
|
37
|
-
This method generates classes which helps you reverse order in row; i.e. if row had divs A, B, C and you apply reverse row class, order will be C, B, A. There are two options:
|
|
38
|
-
1) .reverse-row-DESIRED_BREAKPOINT_DESCRIPTION
|
|
39
|
-
2) .reverse-dow-under-DESIRED_BREAKPOINT_DESCRIPTION
|
|
40
|
-
The first one helps you to reverse order starting from given breakpoint (DESIRED_BREAKPOINT_DESCRIPTION might be sm, md, xxl, depending on what you pass as a breakpoint description). The second one helps you to reverse order on all widths under certain breakpoint.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Text-related methods
|
|
3
|
-
|
|
4
|
-
From time to time we need to prettify and alter some text in HTML. Following methods help us in that.
|
|
5
|
-
|
|
6
|
-
## Text Modification
|
|
7
|
-
|
|
8
|
-
@use scss-foundation/src/text/modification as text-modification;
|
|
9
|
-
|
|
10
|
-
- Capitalizes given string.
|
|
11
|
-
```
|
|
12
|
-
text-modification.capitalize('john'); // returns John
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
- Cuts off lengthy text by adding ellipsis in the end. Behavior heavily depends on context; it cannot be applied on containers with unlimited width.
|
|
16
|
-
```
|
|
17
|
-
@include text-modification.ellipsis();
|
|
18
|
-
```
|
|
19
|
-
This mixin is short-hand for following set of properties:
|
|
20
|
-
```
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
text-overflow: ellipsis;
|
|
23
|
-
white-space: nowrap;
|
|
24
|
-
```
|