claritas-web-framework 5.1.21 → 5.1.22
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/.eslintrc.js +21 -0
- package/.prettierrc +7 -0
- package/dist/index.css +1 -1
- package/dist/index.html +1 -1
- package/index.html +9 -15
- package/index.js +2 -2
- package/js/defaults/getPage.js +4 -4
- package/js/defaults/getSiblings.js +5 -3
- package/js/polyfills/customevent.js +21 -16
- package/js/utilities/{debounce.js → DeBounce.js} +25 -27
- package/js/utilities/isElement.js +11 -11
- package/js/utilities/removehash.js +12 -8
- package/package.json +12 -6
- package/postcss.config.js +42 -46
- package/scss/_base.scss +1 -1
- package/scss/_functions.scss +51 -14
- package/scss/_helpers.scss +1 -1
- package/scss/_mixins.scss +1 -1
- package/scss/_modules.scss +1 -1
- package/scss/_root.scss +1 -1
- package/scss/_utilities.scss +1 -1
- package/scss/_variables.scss +213 -217
- package/scss/helpers/_image.scss +1 -1
- package/scss/helpers/_link.scss +2 -2
- package/scss/helpers/_wrap.scss +1 -1
- package/scss/index.scss +1 -1
- package/scss/mixins/_breakpoints.scss +1 -1
- package/scss/mixins/_wrap.scss +1 -1
- package/scss/modules/_close.scss +1 -1
- package/scss/modules/_details.scss +2 -2
- package/scss/modules/_tag.scss +1 -1
- package/scss/utilities/_colors.scss +1 -1
- package/scss/utilities/_order.scss +1 -1
- package/scss/utilities/_pointerEvents.scss +1 -1
- package/scss/utilities/_size.scss +2 -2
- package/scss/utilities/_translate.scss +1 -1
- package/scss/utilities/_visibility.scss +1 -1
- package/scss/utilities/_zIndex.scss +1 -1
- package/styles/helpers/container.css +1 -1
- package/styles/helpers/embed.css +5 -5
- package/styles/helpers/grid.css +5 -5
- package/styles/helpers/image.css +1 -1
- package/styles/helpers/link.css +2 -2
- package/styles/helpers/wrap.css +1 -1
- package/styles/helpers.css +7 -7
- package/styles/index.css +6 -6
- package/styles/mixins/caret.css +1 -1
- package/styles/mixins/helpers/container.css +1 -1
- package/styles/mixins/helpers/link.css +2 -2
- package/styles/mixins/modules/card.css +1 -1
- package/styles/mixins/modules/close.css +2 -2
- package/styles/mixins/modules/pill.css +1 -1
- package/styles/mixins.css +13 -13
- package/styles/modules/breadcrumbs.css +2 -2
- package/styles/modules/button.css +2 -2
- package/styles/modules/card.css +2 -2
- package/styles/modules/close.css +1 -1
- package/styles/modules/details.css +2 -2
- package/styles/modules/dialog.css +1 -1
- package/styles/modules/dropdown.css +2 -2
- package/styles/modules/form/checkbox.css +4 -4
- package/styles/modules/form/file.css +7 -7
- package/styles/modules/form/progress.css +1 -1
- package/styles/modules/form/radio.css +3 -3
- package/styles/modules/form/range.css +4 -3
- package/styles/modules/form/select.css +3 -2
- package/styles/modules/form.css +0 -2
- package/styles/modules/list.css +4 -4
- package/styles/modules/pill.css +2 -2
- package/styles/modules/table.css +1 -1
- package/styles/modules/tabs.css +5 -5
- package/styles/modules/tag.css +4 -3
- package/styles/modules/tile.css +1 -1
- package/styles/modules.css +17 -17
- package/styles/utilities/align.css +1 -1
- package/styles/utilities/pointer-events.css +1 -1
- package/styles/utilities/position.css +9 -9
- package/styles/utilities/shadow.css +4 -2
- package/styles/utilities/size.css +24 -24
- package/styles/utilities/spacing.css +10 -10
- package/styles/utilities/tooltip.css +4 -4
- package/styles/utilities/translate.css +1 -1
- package/styles/utilities.css +18 -18
- package/styles/vars.css +6 -6
- package/webpack.config.js +41 -41
package/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Claritas Web Framework</title><script defer="defer" src="index.js"></script><link href="./index.css" rel="stylesheet"></head><body></body></html>
|
package/index.html
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</
|
|
12
|
-
|
|
13
|
-
<body>
|
|
14
|
-
|
|
15
|
-
</body>
|
|
16
|
-
|
|
17
|
-
</html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body></body>
|
|
11
|
+
</html>
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Import CSS
|
|
2
|
-
import
|
|
1
|
+
// Import CSS
|
|
2
|
+
import "./scss/index.scss";
|
package/js/defaults/getPage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default String.prototype.getPage = function () {
|
|
2
|
-
const urlArray = this.split(
|
|
3
|
-
return urlArray[urlArray.length - 1].split(
|
|
4
|
-
};
|
|
1
|
+
export default String.prototype.getPage = function () {
|
|
2
|
+
const urlArray = this.split("/");
|
|
3
|
+
return urlArray[urlArray.length - 1].split("?")[0];
|
|
4
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export default Node.prototype.getSiblings = function () {
|
|
2
|
-
return Array.from(this.parentNode.children).filter(
|
|
3
|
-
|
|
1
|
+
export default Node.prototype.getSiblings = function () {
|
|
2
|
+
return Array.from(this.parentNode.children).filter(
|
|
3
|
+
(sibling) => sibling !== this
|
|
4
|
+
);
|
|
5
|
+
};
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
(function () {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (typeof window.CustomEvent ===
|
|
5
|
-
|
|
6
|
-
function CustomEvent(event, params) {
|
|
7
|
-
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
8
|
-
var evt = document.createEvent(
|
|
9
|
-
evt.initCustomEvent(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
(function () {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
if (typeof window.CustomEvent === "function") return false; //If not IE
|
|
5
|
+
|
|
6
|
+
function CustomEvent(event, params) {
|
|
7
|
+
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
8
|
+
var evt = document.createEvent("CustomEvent");
|
|
9
|
+
evt.initCustomEvent(
|
|
10
|
+
event,
|
|
11
|
+
params.bubbles,
|
|
12
|
+
params.cancelable,
|
|
13
|
+
params.detail
|
|
14
|
+
);
|
|
15
|
+
return evt;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
19
|
+
|
|
20
|
+
window.Event = CustomEvent;
|
|
21
|
+
})();
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce functions for better performance
|
|
3
|
-
* @param {Function} fn The function to debounce
|
|
4
|
-
*/
|
|
5
|
-
export function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// Setup a timer
|
|
9
|
-
let timeout;
|
|
10
|
-
|
|
11
|
-
// Return a function to run debounced
|
|
12
|
-
return () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Debounce functions for better performance
|
|
3
|
+
* @param {Function} fn The function to debounce
|
|
4
|
+
*/
|
|
5
|
+
export function DeBounce(fn) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
// Setup a timer
|
|
9
|
+
let timeout;
|
|
10
|
+
|
|
11
|
+
// Return a function to run debounced
|
|
12
|
+
return () => {
|
|
13
|
+
// Setup the arguments
|
|
14
|
+
let context = this;
|
|
15
|
+
let args = arguments;
|
|
16
|
+
|
|
17
|
+
// If there's a timer, cancel it
|
|
18
|
+
if (timeout) {
|
|
19
|
+
window.cancelAnimationFrame(timeout);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Setup the new requestAnimationFrame()
|
|
23
|
+
timeout = window.requestAnimationFrame(() => fn.apply(context, args));
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @desc Checks if an element exists in the DOM
|
|
3
|
-
* @param {Element} element The element to check
|
|
4
|
-
* @return {Boolean} The outcome of the check
|
|
5
|
-
* @example isElement('#myElement');
|
|
6
|
-
*/
|
|
7
|
-
export function isElement(element) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return document.body.contains(document.querySelector(element)) ? true : false;
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @desc Checks if an element exists in the DOM
|
|
3
|
+
* @param {Element} element The element to check
|
|
4
|
+
* @return {Boolean} The outcome of the check
|
|
5
|
+
* @example isElement('#myElement');
|
|
6
|
+
*/
|
|
7
|
+
export function isElement(element) {
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
return document.body.contains(document.querySelector(element)) ? true : false;
|
|
11
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @desc Removes the hash from the page url.
|
|
3
|
-
*/
|
|
4
|
-
export function removeHash() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return history.pushState(
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @desc Removes the hash from the page url.
|
|
3
|
+
*/
|
|
4
|
+
export function removeHash() {
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
return history.pushState(
|
|
8
|
+
"",
|
|
9
|
+
document.title,
|
|
10
|
+
window.location.pathname + window.location.search
|
|
11
|
+
);
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claritas-web-framework",
|
|
3
|
-
"version": "5.1.
|
|
4
|
-
"updated": "
|
|
3
|
+
"version": "5.1.22",
|
|
4
|
+
"updated": "11/05/2022",
|
|
5
5
|
"description": "The CSS framework built for Claritas front end.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "webpack --config webpack.config.js --mode production",
|
|
9
|
-
"start": "webpack serve --config webpack.config.js --mode development"
|
|
9
|
+
"start": "webpack serve --config webpack.config.js --mode development",
|
|
10
|
+
"lint": "eslint . --fix"
|
|
10
11
|
},
|
|
11
12
|
"repository": {
|
|
12
13
|
"type": "git",
|
|
@@ -16,8 +17,12 @@
|
|
|
16
17
|
"license": "ISC",
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@alexlafroscia/postcss-color-mod-function": "^4.0.0",
|
|
20
|
+
"@babel/eslint-plugin": "^7.17.7",
|
|
19
21
|
"css-loader": "^6.7.1",
|
|
20
22
|
"cssnano": "^5.1.7",
|
|
23
|
+
"eslint": "^8.15.0",
|
|
24
|
+
"eslint-config-prettier": "^8.5.0",
|
|
25
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
21
26
|
"html-webpack-plugin": "^5.5.0",
|
|
22
27
|
"mini-css-extract-plugin": "^2.6.0",
|
|
23
28
|
"postcss": "^8.4.13",
|
|
@@ -27,10 +32,11 @@
|
|
|
27
32
|
"postcss-loader": "^6.2.1",
|
|
28
33
|
"postcss-preset-env": "^7.5.0",
|
|
29
34
|
"postcss-scss": "^4.0.4",
|
|
35
|
+
"prettier": "^2.6.2",
|
|
30
36
|
"sass": "^1.51.0",
|
|
31
37
|
"sass-loader": "^12.6.0",
|
|
32
|
-
"webpack": "^5.72.
|
|
38
|
+
"webpack": "^5.72.1",
|
|
33
39
|
"webpack-cli": "^4.9.2",
|
|
34
|
-
"webpack-dev-server": "^4.
|
|
40
|
+
"webpack-dev-server": "^4.9.0"
|
|
35
41
|
}
|
|
36
|
-
}
|
|
42
|
+
}
|
package/postcss.config.js
CHANGED
|
@@ -1,46 +1,42 @@
|
|
|
1
|
-
const postcssImport = require("postcss-import");
|
|
2
|
-
const postcssAdvancedVar = require("postcss-advanced-variables");
|
|
3
|
-
const postcssPresetEnv = require("postcss-preset-env");
|
|
4
|
-
const postcssColorMod = require("@alexlafroscia/postcss-color-mod-function");
|
|
5
|
-
const postcssInlineSvg = require("postcss-inline-svg");
|
|
6
|
-
const cssNano = require("cssnano");
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
plugins: [
|
|
10
|
-
postcssImport({}),
|
|
11
|
-
postcssAdvancedVar({
|
|
12
|
-
disable:
|
|
13
|
-
}),
|
|
14
|
-
postcssColorMod({
|
|
15
|
-
importFrom: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
]
|
|
44
|
-
})
|
|
45
|
-
]
|
|
46
|
-
}
|
|
1
|
+
const postcssImport = require("postcss-import");
|
|
2
|
+
const postcssAdvancedVar = require("postcss-advanced-variables");
|
|
3
|
+
const postcssPresetEnv = require("postcss-preset-env");
|
|
4
|
+
const postcssColorMod = require("@alexlafroscia/postcss-color-mod-function");
|
|
5
|
+
const postcssInlineSvg = require("postcss-inline-svg");
|
|
6
|
+
const cssNano = require("cssnano");
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
plugins: [
|
|
10
|
+
postcssImport({}),
|
|
11
|
+
postcssAdvancedVar({
|
|
12
|
+
disable: "@import",
|
|
13
|
+
}),
|
|
14
|
+
postcssColorMod({
|
|
15
|
+
importFrom: ["./styles/vars.css"],
|
|
16
|
+
unresolved: "warn",
|
|
17
|
+
}),
|
|
18
|
+
postcssPresetEnv({
|
|
19
|
+
stage: 0,
|
|
20
|
+
}),
|
|
21
|
+
postcssInlineSvg({
|
|
22
|
+
paths: ["./images/"],
|
|
23
|
+
removeFill: true,
|
|
24
|
+
removeStroke: true,
|
|
25
|
+
}),
|
|
26
|
+
cssNano({
|
|
27
|
+
preset: [
|
|
28
|
+
"default",
|
|
29
|
+
{
|
|
30
|
+
discardComments: {
|
|
31
|
+
removeAll: true,
|
|
32
|
+
},
|
|
33
|
+
autoprefixer: true,
|
|
34
|
+
colorMin: false,
|
|
35
|
+
mergeLonghand: false,
|
|
36
|
+
mergeRules: false,
|
|
37
|
+
minifySelectors: false,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
};
|
package/scss/_base.scss
CHANGED
package/scss/_functions.scss
CHANGED
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
@function rgba-css-var($identifier, $target) {
|
|
42
42
|
@if $identifier == "body" and $target == "bg" {
|
|
43
43
|
@return rgba(var(--#{$identifier}-bg-rgb), var(--#{$target}-opacity));
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
@if $identifier == "body" and $target == "text" {
|
|
45
46
|
@return rgba(var(--#{$identifier}-color-rgb), var(--#{$target}-opacity));
|
|
46
47
|
} @else {
|
|
47
48
|
@return rgba(var(--#{$identifier}-rgb), var(--#{$target}-opacity));
|
|
@@ -58,7 +59,12 @@
|
|
|
58
59
|
$_args: append($_args, if($arg == "$key", $key, if($arg == "$value", $value, $arg)));
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
$_map: map-merge(
|
|
62
|
+
$_map: map-merge(
|
|
63
|
+
$_map,
|
|
64
|
+
(
|
|
65
|
+
$key: call(get-function($func), $_args...),
|
|
66
|
+
)
|
|
67
|
+
);
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
@return $_map;
|
|
@@ -90,7 +96,12 @@
|
|
|
90
96
|
$result: ();
|
|
91
97
|
@each $key, $value in $map {
|
|
92
98
|
@if (index($values, $key) != null) {
|
|
93
|
-
$result: map-merge(
|
|
99
|
+
$result: map-merge(
|
|
100
|
+
$result,
|
|
101
|
+
(
|
|
102
|
+
$key: $value,
|
|
103
|
+
)
|
|
104
|
+
);
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
@return $result;
|
|
@@ -118,7 +129,8 @@
|
|
|
118
129
|
$index: str-index($string, $search);
|
|
119
130
|
|
|
120
131
|
@if $index {
|
|
121
|
-
@return str-slice($string, 1, $index - 1) + $replace +
|
|
132
|
+
@return str-slice($string, 1, $index - 1) + $replace +
|
|
133
|
+
str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
|
122
134
|
}
|
|
123
135
|
|
|
124
136
|
@return $string;
|
|
@@ -148,9 +160,29 @@
|
|
|
148
160
|
|
|
149
161
|
// A list of pre-calculated numbers of pow(divide((divide($value, 255) + .055), 1.055), 2.4). (from 0 to 255)
|
|
150
162
|
// stylelint-disable-next-line scss/dollar-variable-default, scss/dollar-variable-pattern
|
|
151
|
-
$_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 .0033 .0037 .004 .0044
|
|
152
|
-
|
|
153
|
-
|
|
163
|
+
$_luminance-list: 0.0008 0.001 0.0011 0.0013 0.0015 0.0017 0.002 0.0022 0.0025 0.0027 0.003 0.0033 0.0037 0.004 0.0044
|
|
164
|
+
0.0048 0.0052 0.0056 0.006 0.0065 0.007 0.0075 0.008 0.0086 0.0091 0.0097 0.0103 0.011 0.0116 0.0123 0.013 0.0137
|
|
165
|
+
0.0144 0.0152 0.016 0.0168 0.0176 0.0185 0.0194 0.0203 0.0212 0.0222 0.0232 0.0242 0.0252 0.0262 0.0273 0.0284 0.0296
|
|
166
|
+
0.0307 0.0319 0.0331 0.0343 0.0356 0.0369 0.0382 0.0395 0.0409 0.0423 0.0437 0.0452 0.0467 0.0482 0.0497 0.0513 0.0529
|
|
167
|
+
0.0545 0.0561 0.0578 0.0595 0.0612 0.063 0.0648 0.0666 0.0685 0.0704 0.0723 0.0742 0.0762 0.0782 0.0802 0.0823 0.0844
|
|
168
|
+
0.0865 0.0887 0.0908 0.0931 0.0953 0.0976 0.0999 0.1022 0.1046 0.107 0.1095 0.1119 0.1144 0.117 0.1195 0.1221 0.1248
|
|
169
|
+
0.1274 0.1301 0.1329 0.1356 0.1384 0.1413 0.1441 0.147 0.15 0.1529 0.1559 0.159 0.162 0.1651 0.1683 0.1714 0.1746
|
|
170
|
+
0.1779 0.1812 0.1845 0.1878 0.1912 0.1946 0.1981 0.2016 0.2051 0.2086 0.2122 0.2159 0.2195 0.2232 0.227 0.2307 0.2346
|
|
171
|
+
0.2384 0.2423 0.2462 0.2502 0.2542 0.2582 0.2623 0.2664 0.2705 0.2747 0.2789 0.2831 0.2874 0.2918 0.2961 0.3005 0.305
|
|
172
|
+
0.3095 0.314 0.3185 0.3231 0.3278 0.3325 0.3372 0.3419 0.3467 0.3515 0.3564 0.3613 0.3663 0.3712 0.3763 0.3813 0.3864
|
|
173
|
+
0.3916 0.3968 0.402 0.4072 0.4125 0.4179 0.4233 0.4287 0.4342 0.4397 0.4452 0.4508 0.4564 0.4621 0.4678 0.4735 0.4793
|
|
174
|
+
0.4851 0.491 0.4969 0.5029 0.5089 0.5149 0.521 0.5271 0.5333 0.5395 0.5457 0.552 0.5583 0.5647 0.5711 0.5776 0.5841
|
|
175
|
+
0.5906 0.5972 0.6038 0.6105 0.6172 0.624 0.6308 0.6376 0.6445 0.6514 0.6584 0.6654 0.6724 0.6795 0.6867 0.6939 0.7011
|
|
176
|
+
0.7084 0.7157 0.7231 0.7305 0.7379 0.7454 0.7529 0.7605 0.7682 0.7758 0.7835 0.7913 0.7991 0.807 0.8148 0.8228 0.8308
|
|
177
|
+
0.8388 0.8469 0.855 0.8632 0.8714 0.8796 0.8879 0.8963 0.9047 0.9131 0.9216 0.9301 0.9387 0.9473 0.956 0.9647 0.9734
|
|
178
|
+
0.9823 0.9911 1;
|
|
179
|
+
|
|
180
|
+
@function color-contrast(
|
|
181
|
+
$background,
|
|
182
|
+
$color-contrast-dark: $color-contrast-dark,
|
|
183
|
+
$color-contrast-light: $color-contrast-light,
|
|
184
|
+
$min-contrast-ratio: $min-contrast-ratio
|
|
185
|
+
) {
|
|
154
186
|
$foregrounds: $color-contrast-light, $color-contrast-dark, $white, $black;
|
|
155
187
|
$max-ratio: 0;
|
|
156
188
|
$max-ratio-color: null;
|
|
@@ -174,7 +206,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
|
|
174
206
|
$l1: luminance($background);
|
|
175
207
|
$l2: luminance(opaque($background, $foreground));
|
|
176
208
|
|
|
177
|
-
@return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05));
|
|
209
|
+
@return if($l1 > $l2, divide($l1 + 0.05, $l2 + 0.05), divide($l2 + 0.05, $l1 + 0.05));
|
|
178
210
|
}
|
|
179
211
|
|
|
180
212
|
// Return WCAG2.0 relative luminance
|
|
@@ -184,15 +216,20 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
|
|
184
216
|
$rgb: (
|
|
185
217
|
"r": red($color),
|
|
186
218
|
"g": green($color),
|
|
187
|
-
"b": blue($color)
|
|
219
|
+
"b": blue($color),
|
|
188
220
|
);
|
|
189
221
|
|
|
190
222
|
@each $name, $value in $rgb {
|
|
191
|
-
$value: if(divide($value, 255) < .03928, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
|
|
192
|
-
$rgb: map-merge(
|
|
223
|
+
$value: if(divide($value, 255) < 0.03928, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
|
|
224
|
+
$rgb: map-merge(
|
|
225
|
+
$rgb,
|
|
226
|
+
(
|
|
227
|
+
$name: $value,
|
|
228
|
+
)
|
|
229
|
+
);
|
|
193
230
|
}
|
|
194
231
|
|
|
195
|
-
@return (map-get($rgb, "r") * .2126) + (map-get($rgb, "g") * .7152) + (map-get($rgb, "b") * .0722);
|
|
232
|
+
@return (map-get($rgb, "r") * 0.2126) + (map-get($rgb, "g") * 0.7152) + (map-get($rgb, "b") * 0.0722);
|
|
196
233
|
}
|
|
197
234
|
|
|
198
235
|
// Return opaque color
|
|
@@ -279,7 +316,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
|
|
279
316
|
$quotient: $quotient + 1;
|
|
280
317
|
}
|
|
281
318
|
$result: $result * 10 + $quotient;
|
|
282
|
-
$factor: $factor * .1;
|
|
319
|
+
$factor: $factor * 0.1;
|
|
283
320
|
$remainder: $remainder * 10;
|
|
284
321
|
$precision: $precision - 1;
|
|
285
322
|
@if ($precision < 0 and $remainder >= $divisor * 5) {
|
|
@@ -293,7 +330,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
|
|
293
330
|
"px": 1px,
|
|
294
331
|
"rem": 1rem,
|
|
295
332
|
"em": 1em,
|
|
296
|
-
"%": 1
|
|
333
|
+
"%": 1%,
|
|
297
334
|
);
|
|
298
335
|
@if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
|
|
299
336
|
$result: $result * map-get($unit-map, $dividend-unit);
|
package/scss/_helpers.scss
CHANGED
package/scss/_mixins.scss
CHANGED
package/scss/_modules.scss
CHANGED
package/scss/_root.scss
CHANGED
package/scss/_utilities.scss
CHANGED