@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,196 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
var addSorting = (function() {
|
|
3
|
+
'use strict';
|
|
4
|
+
var cols,
|
|
5
|
+
currentSort = {
|
|
6
|
+
index: 0,
|
|
7
|
+
desc: false
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// returns the summary table element
|
|
11
|
+
function getTable() {
|
|
12
|
+
return document.querySelector('.coverage-summary');
|
|
13
|
+
}
|
|
14
|
+
// returns the thead element of the summary table
|
|
15
|
+
function getTableHeader() {
|
|
16
|
+
return getTable().querySelector('thead tr');
|
|
17
|
+
}
|
|
18
|
+
// returns the tbody element of the summary table
|
|
19
|
+
function getTableBody() {
|
|
20
|
+
return getTable().querySelector('tbody');
|
|
21
|
+
}
|
|
22
|
+
// returns the th element for nth column
|
|
23
|
+
function getNthColumn(n) {
|
|
24
|
+
return getTableHeader().querySelectorAll('th')[n];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onFilterInput() {
|
|
28
|
+
const searchValue = document.getElementById('fileSearch').value;
|
|
29
|
+
const rows = document.getElementsByTagName('tbody')[0].children;
|
|
30
|
+
for (let i = 0; i < rows.length; i++) {
|
|
31
|
+
const row = rows[i];
|
|
32
|
+
if (
|
|
33
|
+
row.textContent
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.includes(searchValue.toLowerCase())
|
|
36
|
+
) {
|
|
37
|
+
row.style.display = '';
|
|
38
|
+
} else {
|
|
39
|
+
row.style.display = 'none';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// loads the search box
|
|
45
|
+
function addSearchBox() {
|
|
46
|
+
var template = document.getElementById('filterTemplate');
|
|
47
|
+
var templateClone = template.content.cloneNode(true);
|
|
48
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
49
|
+
template.parentElement.appendChild(templateClone);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// loads all columns
|
|
53
|
+
function loadColumns() {
|
|
54
|
+
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
55
|
+
colNode,
|
|
56
|
+
cols = [],
|
|
57
|
+
col,
|
|
58
|
+
i;
|
|
59
|
+
|
|
60
|
+
for (i = 0; i < colNodes.length; i += 1) {
|
|
61
|
+
colNode = colNodes[i];
|
|
62
|
+
col = {
|
|
63
|
+
key: colNode.getAttribute('data-col'),
|
|
64
|
+
sortable: !colNode.getAttribute('data-nosort'),
|
|
65
|
+
type: colNode.getAttribute('data-type') || 'string'
|
|
66
|
+
};
|
|
67
|
+
cols.push(col);
|
|
68
|
+
if (col.sortable) {
|
|
69
|
+
col.defaultDescSort = col.type === 'number';
|
|
70
|
+
colNode.innerHTML =
|
|
71
|
+
colNode.innerHTML + '<span class="sorter"></span>';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return cols;
|
|
75
|
+
}
|
|
76
|
+
// attaches a data attribute to every tr element with an object
|
|
77
|
+
// of data values keyed by column name
|
|
78
|
+
function loadRowData(tableRow) {
|
|
79
|
+
var tableCols = tableRow.querySelectorAll('td'),
|
|
80
|
+
colNode,
|
|
81
|
+
col,
|
|
82
|
+
data = {},
|
|
83
|
+
i,
|
|
84
|
+
val;
|
|
85
|
+
for (i = 0; i < tableCols.length; i += 1) {
|
|
86
|
+
colNode = tableCols[i];
|
|
87
|
+
col = cols[i];
|
|
88
|
+
val = colNode.getAttribute('data-value');
|
|
89
|
+
if (col.type === 'number') {
|
|
90
|
+
val = Number(val);
|
|
91
|
+
}
|
|
92
|
+
data[col.key] = val;
|
|
93
|
+
}
|
|
94
|
+
return data;
|
|
95
|
+
}
|
|
96
|
+
// loads all row data
|
|
97
|
+
function loadData() {
|
|
98
|
+
var rows = getTableBody().querySelectorAll('tr'),
|
|
99
|
+
i;
|
|
100
|
+
|
|
101
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
102
|
+
rows[i].data = loadRowData(rows[i]);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// sorts the table using the data for the ith column
|
|
106
|
+
function sortByIndex(index, desc) {
|
|
107
|
+
var key = cols[index].key,
|
|
108
|
+
sorter = function(a, b) {
|
|
109
|
+
a = a.data[key];
|
|
110
|
+
b = b.data[key];
|
|
111
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
112
|
+
},
|
|
113
|
+
finalSorter = sorter,
|
|
114
|
+
tableBody = document.querySelector('.coverage-summary tbody'),
|
|
115
|
+
rowNodes = tableBody.querySelectorAll('tr'),
|
|
116
|
+
rows = [],
|
|
117
|
+
i;
|
|
118
|
+
|
|
119
|
+
if (desc) {
|
|
120
|
+
finalSorter = function(a, b) {
|
|
121
|
+
return -1 * sorter(a, b);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
for (i = 0; i < rowNodes.length; i += 1) {
|
|
126
|
+
rows.push(rowNodes[i]);
|
|
127
|
+
tableBody.removeChild(rowNodes[i]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
rows.sort(finalSorter);
|
|
131
|
+
|
|
132
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
133
|
+
tableBody.appendChild(rows[i]);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// removes sort indicators for current column being sorted
|
|
137
|
+
function removeSortIndicators() {
|
|
138
|
+
var col = getNthColumn(currentSort.index),
|
|
139
|
+
cls = col.className;
|
|
140
|
+
|
|
141
|
+
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
|
142
|
+
col.className = cls;
|
|
143
|
+
}
|
|
144
|
+
// adds sort indicators for current column being sorted
|
|
145
|
+
function addSortIndicators() {
|
|
146
|
+
getNthColumn(currentSort.index).className += currentSort.desc
|
|
147
|
+
? ' sorted-desc'
|
|
148
|
+
: ' sorted';
|
|
149
|
+
}
|
|
150
|
+
// adds event listeners for all sorter widgets
|
|
151
|
+
function enableUI() {
|
|
152
|
+
var i,
|
|
153
|
+
el,
|
|
154
|
+
ithSorter = function ithSorter(i) {
|
|
155
|
+
var col = cols[i];
|
|
156
|
+
|
|
157
|
+
return function() {
|
|
158
|
+
var desc = col.defaultDescSort;
|
|
159
|
+
|
|
160
|
+
if (currentSort.index === i) {
|
|
161
|
+
desc = !currentSort.desc;
|
|
162
|
+
}
|
|
163
|
+
sortByIndex(i, desc);
|
|
164
|
+
removeSortIndicators();
|
|
165
|
+
currentSort.index = i;
|
|
166
|
+
currentSort.desc = desc;
|
|
167
|
+
addSortIndicators();
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
for (i = 0; i < cols.length; i += 1) {
|
|
171
|
+
if (cols[i].sortable) {
|
|
172
|
+
// add the click event handler on the th so users
|
|
173
|
+
// dont have to click on those tiny arrows
|
|
174
|
+
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
|
175
|
+
if (el.addEventListener) {
|
|
176
|
+
el.addEventListener('click', ithSorter(i));
|
|
177
|
+
} else {
|
|
178
|
+
el.attachEvent('onclick', ithSorter(i));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// adds sorting functionality to the UI
|
|
184
|
+
return function() {
|
|
185
|
+
if (!getTable()) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
cols = loadColumns();
|
|
189
|
+
loadData();
|
|
190
|
+
addSearchBox();
|
|
191
|
+
addSortIndicators();
|
|
192
|
+
enableUI();
|
|
193
|
+
};
|
|
194
|
+
})();
|
|
195
|
+
|
|
196
|
+
window.addEventListener('load', addSorting);
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":[],"names":[],"mappings":"","file":"scss-foundation-modules.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.first-letter-capitalized{display:inline-block}.first-letter-capitalized::first-letter{text-transform:capitalize}.capitalized{text-transform:uppercase}/*# sourceMappingURL=scss-foundation.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/partials/core/fonts/_text-control.scss"],"names":[],"mappings":"AAAA,0BACC,qBAEA,wCACC,0BAIF,aACC","file":"scss-foundation.css"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Absolute positioning methods
|
|
2
|
+
|
|
3
|
+
Alignment utilities for absolute positioning of content.
|
|
4
|
+
|
|
5
|
+
## Absolute
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/position/absolute;
|
|
8
|
+
|
|
9
|
+
- Replaces the several most common lines in absolute positioning with just one liner.
|
|
10
|
+
```
|
|
11
|
+
@include absolute.position($top, $right, $bottom, $left);
|
|
12
|
+
```
|
|
13
|
+
All arguments are optional and default to 0. Sets following properties:
|
|
14
|
+
```
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: $top;
|
|
17
|
+
right: $right;
|
|
18
|
+
bottom: $bottom;
|
|
19
|
+
left: $left;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Replaces the several most common lines in absolute positioning for unset values with just one liner.
|
|
23
|
+
```
|
|
24
|
+
@include absolute.position-unset($top, $right, $bottom, $left);
|
|
25
|
+
```
|
|
26
|
+
All arguments are optional and default to unset. Sets the same properties as in previous method.
|
|
27
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Alignment methods
|
|
2
|
+
|
|
3
|
+
Alignment utilities for positioning items using flex.
|
|
4
|
+
|
|
5
|
+
## Items
|
|
6
|
+
|
|
7
|
+
@use scss-foundation/src/display/items;
|
|
8
|
+
|
|
9
|
+
- Center alignment. Wrapper method for following flex settings: flex direction row, justify content on flex start and align items centrally.
|
|
10
|
+
```
|
|
11
|
+
@include items.align-center();
|
|
12
|
+
```
|
|
13
|
+
- Configurable alignment. Everything is same as for the previous method, but align items property is configurable.
|
|
14
|
+
```
|
|
15
|
+
@include items.align($align);
|
|
16
|
+
```
|
|
17
|
+
- Horizontal and vertical central alignment. Wrapper method for following flex settings: flex direction row, justify content centrally and align items centrally.
|
|
18
|
+
```
|
|
19
|
+
@include items.align-absolute-center();
|
|
20
|
+
```
|
|
21
|
+
- Alignment utility. Replaces several line of CSS with just one liner.
|
|
22
|
+
```
|
|
23
|
+
@include items.fully-align($align, $justify, $direction, $wrap);
|
|
24
|
+
```
|
|
25
|
+
Optional arguments and their default values:
|
|
26
|
+
$justify: flex-start, $direction: row, $wrap: wrap
|
|
27
|
+
Sets following properties:
|
|
28
|
+
```
|
|
29
|
+
display: flex;
|
|
30
|
+
flex: {
|
|
31
|
+
direction: $direction;
|
|
32
|
+
wrap: $wrap;
|
|
33
|
+
};
|
|
34
|
+
align-items: $align;
|
|
35
|
+
justify-content: $justify;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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.
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
```
|
package/jest.config.js
ADDED
|
@@ -0,0 +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
|
+
]
|
|
22
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@enigmatry/scss-foundation",
|
|
3
|
+
"version": "1.0.178",
|
|
4
|
+
"author": "Enigmatry",
|
|
5
|
+
"description": "Collection of SCSS utilities useful for the most of projects.",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "sass --style=compressed --load-path=src src/partials/main.scss dist/scss-foundation.css",
|
|
9
|
+
"lint": "stylelint --fix src/**/*.scss",
|
|
10
|
+
"test": "jest --coverage --colors"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@enigmatry/stylelint-config": "^1.0.85",
|
|
14
|
+
"sass": "1.44.0",
|
|
15
|
+
"sass-true": "6.1.0",
|
|
16
|
+
"jest": "27.5.1",
|
|
17
|
+
"stylelint": "14.1.0"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* stylelint-disable-next-line annotation-no-unknown */
|
|
2
|
+
$testing: false !default;
|
|
3
|
+
$default-breakpoints: (
|
|
4
|
+
mobile: ( size: 576px, description: 'sm' ),
|
|
5
|
+
tablet: ( size: 768px, description: 'md' ),
|
|
6
|
+
desktop: ( size: 992px, description: 'lg'),
|
|
7
|
+
largeDesktop: ( size: 1200px, description: 'xl'),
|
|
8
|
+
extraLargeDesktop: ( size: 1400px, description: 'xxl'));
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'border-radius';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'items';
|
|
@@ -0,0 +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;
|
|
22
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../responsiveness/breakpoints';
|
|
3
|
+
|
|
4
|
+
@mixin generate($column-prefix, $offset-prefix, $spacing: 0) {
|
|
5
|
+
.row {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
|
|
9
|
+
@if $spacing != 0 {
|
|
10
|
+
margin: 0 -#{$spacing};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* stylelint-disable-next-line selector-max-attribute */
|
|
14
|
+
[class ^= #{$column-prefix}], [class ^= #{$offset-prefix}] {
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
padding: 0 $spacing;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#{'.' + $column-prefix}auto {
|
|
22
|
+
flex: 0 0 auto;
|
|
23
|
+
width: auto;
|
|
24
|
+
padding: 0 $spacing;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin generate-reverse-row($breakpoints) {
|
|
29
|
+
$reverse-prefix: '.row.reverse-row-';
|
|
30
|
+
$under: 'under-';
|
|
31
|
+
|
|
32
|
+
@each $item, $value in $breakpoints {
|
|
33
|
+
$size: map.get($value, description);
|
|
34
|
+
|
|
35
|
+
@include breakpoints.apply-on($item) {
|
|
36
|
+
#{$reverse-prefix + $size} {
|
|
37
|
+
flex-direction: row-reverse;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@each $item, $value in $breakpoints {
|
|
43
|
+
$size: map.get($value, description);
|
|
44
|
+
|
|
45
|
+
#{$reverse-prefix + $under + $size} {
|
|
46
|
+
flex-direction: row-reverse;
|
|
47
|
+
|
|
48
|
+
@include breakpoints.apply-on($item) {
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* stylelint-disable-next-line annotation-no-unknown */
|
|
2
|
+
$breakpoints: () !default;
|
|
3
|
+
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
@use 'sass:map';
|
|
6
|
+
@use 'sass:math';
|
|
7
|
+
@use '../../modules/variables' as variables;
|
|
8
|
+
@forward '../../modules/responsiveness/breakpoints' with (
|
|
9
|
+
$breakpoints: $breakpoints
|
|
10
|
+
);
|
|
11
|
+
@use '../../modules/responsiveness/breakpoints';
|
|
12
|
+
@use '../../modules/text/modification' as text-modification;
|
|
13
|
+
@use 'grid-core';
|
|
14
|
+
|
|
15
|
+
@if length($breakpoints) == 0 {
|
|
16
|
+
$breakpoints: variables.$default-breakpoints;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
$column-prefix: 'col-';
|
|
20
|
+
$offset-prefix: 'offset-';
|
|
21
|
+
|
|
22
|
+
@mixin generate($spacing:0, $divisions: 12) {
|
|
23
|
+
@if type-of($divisions) != number {
|
|
24
|
+
@error 'Please provide number parameter for divisions! Given value: ' + $divisions;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@if ($divisions < 2 or $divisions > 1000) {
|
|
28
|
+
@error 'Please provide positive number for divisions! Given value: ' + $divisions;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include grid-core.generate($column-prefix, $offset-prefix, $spacing);
|
|
32
|
+
@include grid-core.generate-reverse-row($breakpoints);
|
|
33
|
+
@include -unresponsive-grid-from($spacing, $divisions);
|
|
34
|
+
@include -responsive-grid-from($spacing, $divisions);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@function -calculate-ratio($counter, $divisions) {
|
|
38
|
+
@return math.div(100% * $counter, $divisions);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin -unresponsive-grid-from($spacing, $divisions) {
|
|
42
|
+
$division-limit: $divisions + 1;
|
|
43
|
+
|
|
44
|
+
@for $currentIndex from 1 to ($division-limit) {
|
|
45
|
+
$current-ratio: -calculate-ratio($currentIndex, $divisions);
|
|
46
|
+
|
|
47
|
+
#{'.' + $column-prefix + $currentIndex} {
|
|
48
|
+
flex: 0 0 auto;
|
|
49
|
+
width: $current-ratio;
|
|
50
|
+
padding: 0 $spacing;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#{'.' + $offset-prefix + $currentIndex} {
|
|
54
|
+
margin-left: $current-ratio;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@mixin -responsive-grid-from($spacing, $divisions) {
|
|
60
|
+
$division-limit: $divisions + 1;
|
|
61
|
+
@each $item, $value in $breakpoints {
|
|
62
|
+
$size: map.get($value, description);
|
|
63
|
+
|
|
64
|
+
@include breakpoints.apply-on($item) {
|
|
65
|
+
#{'.' + $column-prefix + $size}-auto {
|
|
66
|
+
flex: 0 0 auto;
|
|
67
|
+
width: auto;
|
|
68
|
+
padding: 0 $spacing;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@for $currentIndex from 1 to $division-limit {
|
|
72
|
+
$current-ratio: -calculate-ratio($currentIndex, $divisions);
|
|
73
|
+
$size-index-suffix: $size + '-' + $currentIndex;
|
|
74
|
+
|
|
75
|
+
#{'.' + $column-prefix + $size-index-suffix} {
|
|
76
|
+
flex: 0 0 auto;
|
|
77
|
+
width: $current-ratio;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#{'.' + $offset-prefix + $size-index-suffix} {
|
|
81
|
+
margin-left: $current-ratio;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'row-coloring';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@mixin odd-row-coloring($color) {
|
|
2
|
+
@include row-coloring($color, odd);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin even-row-coloring($color) {
|
|
6
|
+
@include row-coloring($color, even);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin row-coloring($color, $rows) {
|
|
10
|
+
&:nth-child(#{$rows}) {
|
|
11
|
+
background-color: $color;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@use 'set-position' as set;
|
|
2
|
+
|
|
3
|
+
@mixin position($top: 0, $right: 0, $bottom: 0, $left: 0) {
|
|
4
|
+
@include set.set-position(absolute, $top, $right, $bottom, $left);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@mixin position-unset($top: unset, $right: unset, $bottom: unset, $left: unset) {
|
|
8
|
+
@include set.set-position(absolute, $top, $right, $bottom, $left);
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@use 'set-position' as set;
|
|
2
|
+
|
|
3
|
+
@mixin position($top: 0, $right: 0, $bottom: 0, $left: 0) {
|
|
4
|
+
@include set.set-position(fixed, $top, $right, $bottom, $left);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@mixin position-unset($top: unset, $right: unset, $bottom: unset, $left: unset) {
|
|
8
|
+
@include set.set-position(fixed, $top, $right, $bottom, $left);
|
|
9
|
+
}
|