@enigmatry/scss-foundation 1.0.178
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/.stylelintrc.json +9 -0
- package/README.md +25 -0
- package/coverage/clover.xml +6 -0
- package/coverage/coverage-final.json +1 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +101 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +0 -0
- package/dist/scss-foundation-modules.css.map +1 -0
- package/dist/scss-foundation.css +1 -0
- package/dist/scss-foundation.css.map +1 -0
- package/docs/absolute-positioning.md +27 -0
- package/docs/alignment.md +38 -0
- package/docs/breakpoints.md +23 -0
- package/docs/grid.md +40 -0
- package/docs/text-modification.md +24 -0
- package/jest.config.js +22 -0
- package/package.json +22 -0
- package/src/modules/_index.scss +8 -0
- package/src/modules/_variables.scss +8 -0
- package/src/modules/borders/_border-radius.scss +10 -0
- package/src/modules/borders/_index.scss +1 -0
- package/src/modules/display/_index.scss +1 -0
- package/src/modules/display/_items.scss +22 -0
- package/src/modules/layout/_grid-core.scss +53 -0
- package/src/modules/layout/_grid.scss +86 -0
- package/src/modules/layout/_index.scss +2 -0
- package/src/modules/lists/_index.scss +1 -0
- package/src/modules/lists/_row-coloring.scss +13 -0
- package/src/modules/position/_absolute.scss +9 -0
- package/src/modules/position/_fixed.scss +9 -0
- package/src/modules/position/_index.scss +3 -0
- package/src/modules/position/_set-position.scss +20 -0
- package/src/modules/responsiveness/_breakpoints.scss +57 -0
- package/src/modules/responsiveness/_index.scss +1 -0
- package/src/modules/states/_index.scss +1 -0
- package/src/modules/states/_visibility.scss +15 -0
- package/src/modules/text/_hover.scss +7 -0
- package/src/modules/text/_index.scss +2 -0
- package/src/modules/text/_modification.scss +25 -0
- package/src/partials/core/_index.scss +1 -0
- package/src/partials/core/fonts/_index.scss +1 -0
- package/src/partials/core/fonts/_text-control.scss +11 -0
- package/src/partials/main.scss +1 -0
- package/src/partials/states/_cursors.scss +11 -0
- package/src/partials/states/_index.scss +3 -0
- package/src/partials/states/_resize.scss +3 -0
- package/src/partials/states/_visibility.scss +4 -0
- package/tests/display/items.tests.scss +100 -0
- package/tests/lists/row-coloring.tests.scss +52 -0
- package/tests/position/absolute.tests.scss +66 -0
- package/tests/position/fixed.tests.scss +66 -0
- package/tests/position/set-position.tests.scss +64 -0
- package/tests/shim.test.js +14 -0
- package/tests/text/modification.tests.scss +21 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@mixin set-position($position, $top, $right, $bottom, $left) {
|
|
2
|
+
|
|
3
|
+
$positions: (
|
|
4
|
+
$top,
|
|
5
|
+
$right,
|
|
6
|
+
$bottom,
|
|
7
|
+
$left
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
@each $position in $positions {
|
|
11
|
+
@if (($position != 'unset') and (type-of($position) != number)) {
|
|
12
|
+
@error 'Please provide the right parameters for position (number or 'unset')! Given value: ' + $position;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
position: $position;
|
|
16
|
+
top: $top;
|
|
17
|
+
right: $right;
|
|
18
|
+
bottom: $bottom;
|
|
19
|
+
left: $left;
|
|
20
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* stylelint-disable-next-line annotation-no-unknown */
|
|
2
|
+
$breakpoints: () !default;
|
|
3
|
+
|
|
4
|
+
@use 'sass:list';
|
|
5
|
+
@use 'sass:string';
|
|
6
|
+
@use 'sass:map';
|
|
7
|
+
@use '../../modules/text/modification' as text-modification;
|
|
8
|
+
@use '../../modules/variables' as variables;
|
|
9
|
+
|
|
10
|
+
// Had to be done this way due to current limitations of collection initialization in Sass.
|
|
11
|
+
@if length($breakpoints) == 0 {
|
|
12
|
+
$breakpoints: variables.$default-breakpoints;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@function -get-size($size) {
|
|
16
|
+
@if (map-has-key($breakpoints, $size)) {
|
|
17
|
+
$gotten-size: map.get($breakpoints, $size);
|
|
18
|
+
@return map.get($gotten-size, size);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@error 'Size must be any of following values: ' + map-keys($breakpoints) + '. Given size: ' + $size;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@function -presentation($string, $with-capitalization) {
|
|
25
|
+
@if $with-capitalization == true {
|
|
26
|
+
@return text-modification.capitalize($string);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@return $string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin -set-content($breakpoint, $with-capitalization) {
|
|
33
|
+
content: string.quote(-presentation($breakpoint, $with-capitalization));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@mixin apply-on($given-size) {
|
|
37
|
+
/* stylelint-disable-next-line at-rule-allowed-list */
|
|
38
|
+
@media only screen and (min-width: -get-size($given-size)) {
|
|
39
|
+
@content;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@mixin set-up($with-capitalization: true) {
|
|
44
|
+
@each $breakpoint, $value in $breakpoints {
|
|
45
|
+
$currentIndex: list.index($breakpoints, ($breakpoint $value));
|
|
46
|
+
|
|
47
|
+
@if $currentIndex == 1 {
|
|
48
|
+
@include -set-content($breakpoint, $with-capitalization);
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
@else {
|
|
52
|
+
@include apply-on($breakpoint) {
|
|
53
|
+
@include -set-content($breakpoint, $with-capitalization);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'breakpoints';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'visibility';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@mixin show-on-mobile($mobile-state: block) {
|
|
2
|
+
@include -toggle-state($mobile-state, none);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin show-on-tablet($tablet-state: block) {
|
|
6
|
+
@include -toggle-state(none, $tablet-state);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin -toggle-state($mobile-state, $tablet-state) {
|
|
10
|
+
display: $mobile-state;
|
|
11
|
+
|
|
12
|
+
@include breakpoints.apply-on-tablet() {
|
|
13
|
+
display: $tablet-state;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use 'sass:string';
|
|
2
|
+
@use '../../modules/variables' as vars;
|
|
3
|
+
|
|
4
|
+
@function capitalize($string) {
|
|
5
|
+
@if type-of($string) != string {
|
|
6
|
+
$error-message: 'Please provide string parameter! Given value: ' + $string;
|
|
7
|
+
|
|
8
|
+
@if vars.$testing == true {
|
|
9
|
+
@return $error-message;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@error $error-message;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@return to-upper-case(str-slice($string, 1, 1)) + str-slice($string, 2);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin ellipsis($num: 1) {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
-webkit-line-clamp: $num;
|
|
24
|
+
-webkit-box-orient: vertical;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'fonts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'text-control';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'core';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@use '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@use '../../src/modules/display/items';
|
|
3
|
+
|
|
4
|
+
@include true.describe('align($align)') {
|
|
5
|
+
@include true.it('should be centered. if direction not provided then it should be flex-start') {
|
|
6
|
+
@include true.assert() {
|
|
7
|
+
@include true.output() {
|
|
8
|
+
@include items.align(center);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include true.expect() {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex: {
|
|
14
|
+
direction: row;
|
|
15
|
+
wrap: wrap;
|
|
16
|
+
}
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@include true.describe('align-absolute-center()') {
|
|
25
|
+
@include true.it('should be centered') {
|
|
26
|
+
@include true.assert() {
|
|
27
|
+
@include true.output() {
|
|
28
|
+
@include items.align-absolute-center();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include true.expect() {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex: {
|
|
34
|
+
direction: row;
|
|
35
|
+
wrap: wrap;
|
|
36
|
+
}
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@include true.describe('align-center()') {
|
|
45
|
+
@include true.it('should set default values and align centered') {
|
|
46
|
+
@include true.assert() {
|
|
47
|
+
@include true.output() {
|
|
48
|
+
@include items.align-center();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@include true.expect() {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex: {
|
|
54
|
+
direction: row;
|
|
55
|
+
wrap: wrap;
|
|
56
|
+
}
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: flex-start;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include true.describe('fully-align($align, $justify, $direction $wrap)') {
|
|
65
|
+
@include true.it('should set default values and align baseline') {
|
|
66
|
+
@include true.assert() {
|
|
67
|
+
@include true.output() {
|
|
68
|
+
@include items.fully-align(baseline);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@include true.expect() {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex: {
|
|
74
|
+
direction: row;
|
|
75
|
+
wrap: wrap;
|
|
76
|
+
}
|
|
77
|
+
align-items: baseline;
|
|
78
|
+
justify-content: flex-start;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@include true.it('should set properties in given order') {
|
|
84
|
+
@include true.assert() {
|
|
85
|
+
@include true.output() {
|
|
86
|
+
@include items.fully-align(flex-end, space-between, column, nowrap);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@include true.expect() {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex: {
|
|
92
|
+
direction: column;
|
|
93
|
+
wrap: nowrap;
|
|
94
|
+
}
|
|
95
|
+
align-items: flex-end;
|
|
96
|
+
justify-content: space-between;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '../../node_modules/sass-true/sass/true';
|
|
3
|
+
@use '../../src/modules/lists/row-coloring' as lists;
|
|
4
|
+
|
|
5
|
+
@include true.describe('row-coloring($color, $rows)') {
|
|
6
|
+
@include true.it('should set background #EBEBEB color to third element') {
|
|
7
|
+
@include true.assert() {
|
|
8
|
+
@include true.output() {
|
|
9
|
+
@include lists.row-coloring(#EBEBEB, 3);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@include true.expect() {
|
|
13
|
+
&:nth-child(3) {
|
|
14
|
+
background-color: #EBEBEB;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@include true.describe('even-row-coloring($color)') {
|
|
22
|
+
@include true.it('should set background #000, $alpha: -1 color to all even element') {
|
|
23
|
+
@include true.assert() {
|
|
24
|
+
@include true.output() {
|
|
25
|
+
@include lists.even-row-coloring(color.adjust(#000, $alpha: -1));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@include true.expect() {
|
|
29
|
+
&:nth-child(even) {
|
|
30
|
+
background-color: color.adjust(#000, $alpha: -1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include true.describe('odd-row-coloring($color)') {
|
|
38
|
+
@include true.it('should set background color of variable $background-color to all odd element') {
|
|
39
|
+
$background-color: #EBEBEB;
|
|
40
|
+
@include true.assert() {
|
|
41
|
+
@include true.output() {
|
|
42
|
+
@include lists.odd-row-coloring($background-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@include true.expect() {
|
|
46
|
+
&:nth-child(odd) {
|
|
47
|
+
background-color: $background-color;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@use '../../src/modules/position/absolute';
|
|
3
|
+
|
|
4
|
+
@include true.describe('position($top, $right, $bottom, $left)') {
|
|
5
|
+
@include true.it('should default to zero-based if position not provided') {
|
|
6
|
+
@include true.assert() {
|
|
7
|
+
@include true.output() {
|
|
8
|
+
@include absolute.position();
|
|
9
|
+
}
|
|
10
|
+
@include true.expect() {
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include true.it('should set position to given in right order') {
|
|
21
|
+
@include true.assert() {
|
|
22
|
+
@include true.output() {
|
|
23
|
+
@include absolute.position(5px, 3em, 14rem, -8px);
|
|
24
|
+
}
|
|
25
|
+
@include true.expect() {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 5px;
|
|
28
|
+
right: 3em;
|
|
29
|
+
bottom: 14rem;
|
|
30
|
+
left: -8px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include true.describe('position-unset($top, $right, $bottom, $left)') {
|
|
37
|
+
@include true.it('should default to unset-based if position not provided') {
|
|
38
|
+
@include true.assert() {
|
|
39
|
+
@include true.output() {
|
|
40
|
+
@include absolute.position-unset();
|
|
41
|
+
}
|
|
42
|
+
@include true.expect() {
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: unset;
|
|
45
|
+
right: unset;
|
|
46
|
+
bottom: unset;
|
|
47
|
+
left: unset;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include true.it('should set position to given in right order') {
|
|
53
|
+
@include true.assert() {
|
|
54
|
+
@include true.output() {
|
|
55
|
+
@include absolute.position-unset(5px, 3em, 14rem);
|
|
56
|
+
}
|
|
57
|
+
@include true.expect() {
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 5px;
|
|
60
|
+
right: 3em;
|
|
61
|
+
bottom: 14rem;
|
|
62
|
+
left: unset;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@use '../../src/modules/position/fixed';
|
|
3
|
+
|
|
4
|
+
@include true.describe('position($top, $right, $bottom, $left)') {
|
|
5
|
+
@include true.it('should default to zero-based if position not provided') {
|
|
6
|
+
@include true.assert() {
|
|
7
|
+
@include true.output() {
|
|
8
|
+
@include fixed.position();
|
|
9
|
+
}
|
|
10
|
+
@include true.expect() {
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include true.it('should set position to given in right order') {
|
|
21
|
+
@include true.assert() {
|
|
22
|
+
@include true.output() {
|
|
23
|
+
@include fixed.position(5px, 15px, 20px, 1px);
|
|
24
|
+
}
|
|
25
|
+
@include true.expect() {
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 5px;
|
|
28
|
+
right: 15px;
|
|
29
|
+
bottom: 20px;
|
|
30
|
+
left: 1px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include true.describe('position-unset($top, $right, $bottom, $left)') {
|
|
37
|
+
@include true.it('should default to unset-based if position not provided') {
|
|
38
|
+
@include true.assert() {
|
|
39
|
+
@include true.output() {
|
|
40
|
+
@include fixed.position-unset();
|
|
41
|
+
}
|
|
42
|
+
@include true.expect() {
|
|
43
|
+
position: fixed;
|
|
44
|
+
top: unset;
|
|
45
|
+
right: unset;
|
|
46
|
+
bottom: unset;
|
|
47
|
+
left: unset;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include true.it('should set position to given in right order') {
|
|
53
|
+
@include true.assert() {
|
|
54
|
+
@include true.output() {
|
|
55
|
+
@include fixed.position-unset(5px, 15px, 20px);
|
|
56
|
+
}
|
|
57
|
+
@include true.expect() {
|
|
58
|
+
position: fixed;
|
|
59
|
+
top: 5px;
|
|
60
|
+
right: 15px;
|
|
61
|
+
bottom: 20px;
|
|
62
|
+
left: unset;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@use '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@use '../../src/modules/position/set-position' as position;
|
|
3
|
+
|
|
4
|
+
@include true.describe('set-position($top, $right, $bottom, $left, $position)') {
|
|
5
|
+
@include true.it('should set the type of positioning and the four positions.') {
|
|
6
|
+
@include true.assert() {
|
|
7
|
+
@include true.output() {
|
|
8
|
+
@include position.set-position(absolute, 5px, 3em, 14rem, -8px);
|
|
9
|
+
}
|
|
10
|
+
@include true.expect() {
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 5px;
|
|
13
|
+
right: 3em;
|
|
14
|
+
bottom: 14rem;
|
|
15
|
+
left: -8px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include true.it('should set the type of positioning and the four positions.') {
|
|
21
|
+
@include true.assert() {
|
|
22
|
+
@include true.output() {
|
|
23
|
+
@include position.set-position(fixed, 5px, 1px, 1em, 100px);
|
|
24
|
+
}
|
|
25
|
+
@include true.expect() {
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 5px;
|
|
28
|
+
right: 1px;
|
|
29
|
+
bottom: 1em;
|
|
30
|
+
left: 100px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include true.it('should set the type of positioning and the four positions.') {
|
|
36
|
+
@include true.assert() {
|
|
37
|
+
@include true.output() {
|
|
38
|
+
@include position.set-position(static, 5px, 1px, 1em, 100px);
|
|
39
|
+
}
|
|
40
|
+
@include true.expect() {
|
|
41
|
+
position: static;
|
|
42
|
+
top: 5px;
|
|
43
|
+
right: 1px;
|
|
44
|
+
bottom: 1em;
|
|
45
|
+
left: 100px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include true.it('should set the type of positioning and the four positions.') {
|
|
51
|
+
@include true.assert() {
|
|
52
|
+
@include true.output() {
|
|
53
|
+
@include position.set-position(relative, 5px, 1px, 1em, 100px);
|
|
54
|
+
}
|
|
55
|
+
@include true.expect() {
|
|
56
|
+
position: relative;
|
|
57
|
+
top: 5px;
|
|
58
|
+
right: 1px;
|
|
59
|
+
bottom: 1em;
|
|
60
|
+
left: 100px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment node
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const sassTrue = require('sass-true');
|
|
7
|
+
const glob = require('glob');
|
|
8
|
+
|
|
9
|
+
describe('Scss unit tests', () => {
|
|
10
|
+
const paths = path.resolve(process.cwd(), 'tests/**/*.tests.scss');
|
|
11
|
+
const sassTestFiles = glob.sync(paths);
|
|
12
|
+
|
|
13
|
+
sassTestFiles.forEach(file => sassTrue.runSass({ file }, { describe, it }));
|
|
14
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@use '../../src/modules/variables';
|
|
3
|
+
@use '../../src/modules/text/modification';
|
|
4
|
+
|
|
5
|
+
variables.$testing: true;
|
|
6
|
+
|
|
7
|
+
@include true.describe('capitalize(word)') {
|
|
8
|
+
@include true.it('should throw if word is not a string') {
|
|
9
|
+
$expected-message: 'Please provide string parameter! Given value: ';
|
|
10
|
+
@include true.assert-equal(modification.capitalize(5), $expected-message + '5');
|
|
11
|
+
@include true.assert-equal(modification.capitalize(null), $expected-message);
|
|
12
|
+
@include true.assert-equal(modification.capitalize(#FFEEAA), $expected-message + '#FFEEAA');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include true.it('should return string with first letter capitalized') {
|
|
16
|
+
@include true.assert-equal(modification.capitalize('house'), 'House');
|
|
17
|
+
@include true.assert-equal(modification.capitalize('dOg'),'DOg');
|
|
18
|
+
@include true.assert-equal(modification.capitalize('Dang'), 'Dang');
|
|
19
|
+
@include true.assert-equal(modification.capitalize('4pple'), '4pple');
|
|
20
|
+
}
|
|
21
|
+
}
|