@graupl/graupl 1.0.0-alpha.1 → 1.0.0-alpha.3
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/CHANGELOG.md +44 -0
- package/dist/base/form/form.css +1 -77
- package/dist/base/form/form.css.map +1 -1
- package/dist/base/link/link.css +1 -25
- package/dist/base/link/link.css.map +1 -1
- package/dist/component/button/button.css +1 -61
- package/dist/component/button/button.css.map +1 -1
- package/dist/graupl.css +1 -284
- package/dist/graupl.css.map +1 -1
- package/dist/layout/columns/columns.css +1 -40
- package/dist/layout/columns/columns.css.map +1 -1
- package/dist/layout/container/container.css +1 -37
- package/dist/layout/container/container.css.map +1 -1
- package/dist/state/focus/focus.css +1 -9
- package/dist/state/focus/focus.css.map +1 -1
- package/dist/theme/theme.css +1 -41
- package/dist/theme/theme.css.map +1 -1
- package/dist/utilities/background/background.css +1 -0
- package/dist/utilities/colors/colors.css +2 -0
- package/dist/utilities/colors/colors.css.map +1 -0
- package/docs/.vitepress/config.js +41 -1
- package/docs/.vitepress/theme/custom.scss +29 -29
- package/docs/compiling-graupl.md +56 -0
- package/docs/introduction.md +5 -0
- package/index.html +11 -2
- package/package.json +27 -1
- package/postcss.config.cjs +1 -1
- package/scss/_defaults.scss +3 -0
- package/scss/_index.scss +14 -0
- package/scss/_init.scss +3 -0
- package/scss/base/form/_index.scss +12 -0
- package/scss/base/form/_variables.scss +8 -8
- package/scss/base/link/_variables.scss +5 -8
- package/scss/component/button/_defaults.scss +2 -0
- package/scss/component/button/_index.scss +47 -19
- package/scss/component/button/_variables.scss +36 -10
- package/scss/functions/_important.scss +11 -0
- package/scss/functions/_theme.scss +11 -0
- package/scss/graupl.scss +1 -5
- package/scss/layout/columns/_index.scss +1 -1
- package/scss/state/focus/_variables.scss +3 -3
- package/scss/theme/_defaults.scss +48 -31
- package/scss/theme/_index.scss +13 -28
- package/scss/theme/_variables.scss +94 -280
- package/scss/utilities/_index.scss +3 -0
- package/scss/utilities/colors/_defaults.scss +7 -0
- package/scss/utilities/colors/_index.scss +22 -0
- package/scss/utilities/colors/_variables.scss +3 -0
- package/scss/utilities/colors/colors.scss +3 -0
|
@@ -1,11 +1,51 @@
|
|
|
1
1
|
import { defineConfig } from "vitepress";
|
|
2
2
|
|
|
3
|
+
// Get the current version from the package.json file.
|
|
4
|
+
import { version } from "../../package.json";
|
|
5
|
+
|
|
3
6
|
export default defineConfig({
|
|
4
7
|
lang: "en-US",
|
|
5
8
|
title: "Graupl",
|
|
6
9
|
description: "A modular and modern CSS framework.",
|
|
7
10
|
base: "/graupl/",
|
|
8
11
|
themeConfig: {
|
|
9
|
-
|
|
12
|
+
nav: [
|
|
13
|
+
{
|
|
14
|
+
text: "Docs",
|
|
15
|
+
link: "/introduction",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
text: version,
|
|
19
|
+
items: [
|
|
20
|
+
{
|
|
21
|
+
text: "Current release",
|
|
22
|
+
link: `https://github.com/Graupl/graupl/releases/tag/v${version}`,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
text: "Changelog",
|
|
26
|
+
link: "https://github.com/Graupl/graupl/blob/1.x/CHANGELOG.md",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
text: "Contributing",
|
|
30
|
+
link: "https://github.com/Graupl/graupl/blob/1.x/.github/CONTRIBUTING.md",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
socialLinks: [{ icon: "github", link: "https://github.com/Graupl/graupl" }],
|
|
37
|
+
|
|
38
|
+
sidebar: {
|
|
39
|
+
"/": [
|
|
40
|
+
{
|
|
41
|
+
text: "Getting Started",
|
|
42
|
+
items: [{ text: "Introduction", link: "/introduction" }],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
text: "Advenced Topics",
|
|
46
|
+
items: [{ text: "Compiling Graupl", link: "/compiling-graupl" }],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
10
50
|
},
|
|
11
51
|
});
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
@use "../../../scss/theme
|
|
1
|
+
@use "../../../scss/functions/theme";
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
--vp-c-brand: #{theme
|
|
5
|
-
--vp-c-brand-1: #{theme
|
|
6
|
-
--vp-c-brand-2: #{theme
|
|
7
|
-
--vp-c-brand-3: #{theme
|
|
8
|
-
--vp-c-bg: #{theme
|
|
9
|
-
--vp-c-bg-alt: #{theme
|
|
10
|
-
--vp-c-bg-elv: #{theme
|
|
11
|
-
--vp-c-bg-soft: #{theme
|
|
12
|
-
--vp-c-border: #{theme
|
|
13
|
-
--vp-c-divider: #{theme
|
|
14
|
-
--vp-c-gutter: #{theme
|
|
15
|
-
--vp-c-text-1: #{theme
|
|
16
|
-
--vp-c-text-2: #{theme
|
|
17
|
-
--vp-c-text-3: #{theme
|
|
4
|
+
--vp-c-brand: #{theme.get(primary, 700)};
|
|
5
|
+
--vp-c-brand-1: #{theme.get(primary, 700)};
|
|
6
|
+
--vp-c-brand-2: #{theme.get(primary, 700)};
|
|
7
|
+
--vp-c-brand-3: #{theme.get(primary, 700)};
|
|
8
|
+
--vp-c-bg: #{theme.get(primary, 100)};
|
|
9
|
+
--vp-c-bg-alt: #{theme.get(primary, 100)};
|
|
10
|
+
--vp-c-bg-elv: #{theme.get(primary, 100)};
|
|
11
|
+
--vp-c-bg-soft: #{theme.get(primary, 100)};
|
|
12
|
+
--vp-c-border: #{theme.get(tertiary, 700)};
|
|
13
|
+
--vp-c-divider: #{theme.get(secondary, 700)};
|
|
14
|
+
--vp-c-gutter: #{theme.get(secondary, 700)};
|
|
15
|
+
--vp-c-text-1: #{theme.get(primary, 900)};
|
|
16
|
+
--vp-c-text-2: #{theme.get(primary, 900)};
|
|
17
|
+
--vp-c-text-3: #{theme.get(primary, 900)};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.dark {
|
|
21
|
-
--vp-c-brand: #{theme
|
|
22
|
-
--vp-c-brand-1: #{theme
|
|
23
|
-
--vp-c-brand-2: #{theme
|
|
24
|
-
--vp-c-brand-3: #{theme
|
|
25
|
-
--vp-c-bg: #{theme
|
|
26
|
-
--vp-c-bg-alt: #{theme
|
|
27
|
-
--vp-c-bg-elv: #{theme
|
|
28
|
-
--vp-c-bg-soft: #{theme
|
|
29
|
-
--vp-c-border: #{theme
|
|
30
|
-
--vp-c-divider: #{theme
|
|
31
|
-
--vp-c-gutter: #{theme
|
|
32
|
-
--vp-c-text-1: #{theme
|
|
33
|
-
--vp-c-text-2: #{theme
|
|
34
|
-
--vp-c-text-3: #{theme
|
|
21
|
+
--vp-c-brand: #{theme.get(primary, 300)};
|
|
22
|
+
--vp-c-brand-1: #{theme.get(primary, 300)};
|
|
23
|
+
--vp-c-brand-2: #{theme.get(primary, 300)};
|
|
24
|
+
--vp-c-brand-3: #{theme.get(primary, 300)};
|
|
25
|
+
--vp-c-bg: #{theme.get(primary, 900)};
|
|
26
|
+
--vp-c-bg-alt: #{theme.get(primary, 900)};
|
|
27
|
+
--vp-c-bg-elv: #{theme.get(primary, 900)};
|
|
28
|
+
--vp-c-bg-soft: #{theme.get(primary, 900)};
|
|
29
|
+
--vp-c-border: #{theme.get(tertiary, 300)};
|
|
30
|
+
--vp-c-divider: #{theme.get(secondary, 300)};
|
|
31
|
+
--vp-c-gutter: #{theme.get(secondary, 300)};
|
|
32
|
+
--vp-c-text-1: #{theme.get(primary, 100)};
|
|
33
|
+
--vp-c-text-2: #{theme.get(primary, 100)};
|
|
34
|
+
--vp-c-text-3: #{theme.get(primary, 100)};
|
|
35
35
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Compiling your own version of Graupl
|
|
2
|
+
|
|
3
|
+
If you want to compile your own version of Graupl, you can! Here's how:
|
|
4
|
+
|
|
5
|
+
```scss
|
|
6
|
+
// Import Graupl.
|
|
7
|
+
@forward '@graupl/graupl';
|
|
8
|
+
|
|
9
|
+
// Import your own theme...
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Overriding Graupl's default variables
|
|
13
|
+
|
|
14
|
+
Graupl's sass variables are all declared with `!default` flag. This means you can override them in your own theme file.
|
|
15
|
+
|
|
16
|
+
```scss
|
|
17
|
+
// Import the file containing the variables you want to override.
|
|
18
|
+
@forward '@graupl/graupl/defaults' with (
|
|
19
|
+
$prefix: 'custom',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// Import Graupl.
|
|
23
|
+
@forward '@graupl/graupl';
|
|
24
|
+
|
|
25
|
+
// Import your own theme...
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Adding new theme colours
|
|
29
|
+
|
|
30
|
+
You can add new colours to Graupl by adding to the `$custom-colours` map.
|
|
31
|
+
|
|
32
|
+
```scss
|
|
33
|
+
// Import the theme's defaults.
|
|
34
|
+
@forward "@graupl/graupl/theme/defaults" with (
|
|
35
|
+
$custom-colors: (
|
|
36
|
+
custom: (
|
|
37
|
+
100: #f0f0f0,
|
|
38
|
+
200: #e0e0e0,
|
|
39
|
+
300: #d0d0d0,
|
|
40
|
+
400: #c0c0c0,
|
|
41
|
+
500: #b0b0b0,
|
|
42
|
+
600: #a0a0a0,
|
|
43
|
+
700: #909090,
|
|
44
|
+
800: #808080,
|
|
45
|
+
900: #707070,
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// Import Graupl.
|
|
51
|
+
@forward '@graupl/graupl';
|
|
52
|
+
|
|
53
|
+
// Import your own theme...
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
These colours will have new classes generated for them, e.g. `background-custom-100`, `color-custom-100`, etc. as well as component variants, e.g. `button custom`, and full dark-mode support.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
Graupl is a collection of Sass utilities and components that can be used to build a website or web application. It is designed to be flexible and customizable, so you can use as much or as little of it as you need.
|
|
4
|
+
|
|
5
|
+
We need a lot more documentation, so sit tight!
|
package/index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en"
|
|
2
|
+
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@@ -19,11 +19,15 @@
|
|
|
19
19
|
<p>Graupl supports light and dark modes out-of-the-box.</p>
|
|
20
20
|
<h2>Buttons</h2>
|
|
21
21
|
<p>There are 4 colours of buttons supported by default, with plans to have a "graupl-theme" plugin that adds more.</p>
|
|
22
|
-
<div class="columns
|
|
22
|
+
<div class="columns count-4">
|
|
23
23
|
<button class="button">Default Button</button>
|
|
24
24
|
<button class="button primary">Primary Button</button>
|
|
25
25
|
<button class="button secondary">Secondary Button</button>
|
|
26
26
|
<button class="button tertiary">Tertiary Button</button>
|
|
27
|
+
<button class="button" disabled>Default Button</button>
|
|
28
|
+
<button class="button primary" disabled>Primary Button</button>
|
|
29
|
+
<button class="button secondary" disabled>Secondary Button</button>
|
|
30
|
+
<button class="button tertiary" disabled>Tertiary Button</button>
|
|
27
31
|
</div>
|
|
28
32
|
<h2>Form elements</h2>
|
|
29
33
|
<p>Graupl provides default styling for all form elements.</p>
|
|
@@ -94,6 +98,11 @@
|
|
|
94
98
|
<label for="radio-checked"><input type="radio" id="radio-checked" name="radio" checked> Checked Radio</label>
|
|
95
99
|
<label for="radio-disabled"><input type="radio" id="radio-disabled" name="radio" disabled> Disabled Radio</label>
|
|
96
100
|
</fieldset>
|
|
101
|
+
<fieldset disabled>
|
|
102
|
+
<legend>Disabled Fieldset</legend>
|
|
103
|
+
<label for="disabled-fieldset-checkbox">
|
|
104
|
+
<input type="checkbox" id="disabled-fieldset-checkbox"> Checkbox</label>
|
|
105
|
+
</fieldset>
|
|
97
106
|
<label for="range">Range</label>
|
|
98
107
|
<input type="range" class="range" id="range">
|
|
99
108
|
</main>
|
package/package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graupl/graupl",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "A modular and modern CSS framework.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"sass": "./scss"
|
|
9
|
+
},
|
|
10
|
+
"./base": {
|
|
11
|
+
"sass": "./scss/base"
|
|
12
|
+
},
|
|
13
|
+
"./components": {
|
|
14
|
+
"sass": "./scss/component"
|
|
15
|
+
},
|
|
16
|
+
"./layout": {
|
|
17
|
+
"sass": "./scss/layout"
|
|
18
|
+
},
|
|
19
|
+
"./mixins": {
|
|
20
|
+
"sass": "./scss/mixins"
|
|
21
|
+
},
|
|
22
|
+
"./state": {
|
|
23
|
+
"sass": "./scss/state"
|
|
24
|
+
},
|
|
25
|
+
"./theme": {
|
|
26
|
+
"sass": "./scss/theme"
|
|
27
|
+
},
|
|
28
|
+
"./utilities": {
|
|
29
|
+
"sass": "./scss/utilities"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
6
32
|
"scripts": {
|
|
7
33
|
"prepare": "husky install",
|
|
8
34
|
"commit": "git cz",
|
package/postcss.config.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const config = {
|
|
|
4
4
|
require("autoprefixer"),
|
|
5
5
|
// @todo: add cssnano when ready
|
|
6
6
|
// Waiting on upstream issue for postcss-calc: https://github.com/postcss/postcss-calc/issues/77
|
|
7
|
-
|
|
7
|
+
require("cssnano"),
|
|
8
8
|
require("postcss-discard-comments"),
|
|
9
9
|
],
|
|
10
10
|
};
|
package/scss/_defaults.scss
CHANGED
package/scss/_index.scss
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Graupl Components.
|
|
2
|
+
//
|
|
3
|
+
// Forwards all components for easy development.
|
|
4
|
+
|
|
5
|
+
// Forward the layer initialization.
|
|
6
|
+
@forward "init";
|
|
7
|
+
|
|
8
|
+
// Forward all layers.
|
|
9
|
+
@forward "base";
|
|
10
|
+
@forward "layout";
|
|
11
|
+
@forward "component";
|
|
12
|
+
@forward "state";
|
|
13
|
+
@forward "theme";
|
|
14
|
+
@forward "utilities";
|
package/scss/_init.scss
ADDED
|
@@ -31,6 +31,14 @@
|
|
|
31
31
|
border-style: $fieldset-border-style;
|
|
32
32
|
border-radius: $fieldset-border-radius;
|
|
33
33
|
font-size: $fieldset-font-size;
|
|
34
|
+
|
|
35
|
+
&:disabled {
|
|
36
|
+
input,
|
|
37
|
+
textarea,
|
|
38
|
+
select {
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
|
|
@@ -73,6 +81,10 @@
|
|
|
73
81
|
&:disabled {
|
|
74
82
|
border-color: $fieldset-disabled-border-color;
|
|
75
83
|
color: $fieldset-disabled-color;
|
|
84
|
+
|
|
85
|
+
label {
|
|
86
|
+
color: $label-disabled-color;
|
|
87
|
+
}
|
|
76
88
|
}
|
|
77
89
|
}
|
|
78
90
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
3
|
@use "../../variables" as base;
|
|
4
|
-
@use "../../theme/variables" as theme;
|
|
5
4
|
@use "defaults";
|
|
6
5
|
@use "sass:map";
|
|
6
|
+
@use "../../functions/theme";
|
|
7
7
|
|
|
8
8
|
$input-padding-x: var(--#{defaults.$prefix}-input-padding-x, #{base.$gap});
|
|
9
9
|
$input-padding-y: var(
|
|
@@ -47,7 +47,7 @@ $fieldset-font-size: var(
|
|
|
47
47
|
// Background properties.
|
|
48
48
|
$input-background: var(
|
|
49
49
|
--#{defaults.$prefix}-input-background,
|
|
50
|
-
#{theme
|
|
50
|
+
#{theme.get(primary, 100)}
|
|
51
51
|
);
|
|
52
52
|
$fieldset-background: var(
|
|
53
53
|
--#{defaults.$prefix}-fieldset-background,
|
|
@@ -57,17 +57,17 @@ $fieldset-background: var(
|
|
|
57
57
|
// Text properties.
|
|
58
58
|
$input-color: var(
|
|
59
59
|
--#{defaults.$prefix}-input-color,
|
|
60
|
-
#{theme
|
|
60
|
+
#{theme.get(primary, 900)}
|
|
61
61
|
);
|
|
62
62
|
$input-placeholder-color: var(
|
|
63
63
|
--#{defaults.$prefix}-input-placeholder-color,
|
|
64
|
-
#{theme
|
|
64
|
+
#{theme.get(secondary, 600)}
|
|
65
65
|
);
|
|
66
66
|
$label-color: var(--#{defaults.$prefix}-label-color, #{$input-color});
|
|
67
67
|
$fieldset-color: var(--#{defaults.$prefix}-fieldset-color, #{$input-color});
|
|
68
68
|
$input-disabled-color: var(
|
|
69
69
|
--#{defaults.$prefix}-input-disabled-color,
|
|
70
|
-
#{theme
|
|
70
|
+
#{theme.get(secondary, 400)}
|
|
71
71
|
);
|
|
72
72
|
$input-disabled-placeholder-color: var(
|
|
73
73
|
--#{defaults.$prefix}-input-disabled-placeholder-color,
|
|
@@ -111,11 +111,11 @@ $fieldset-border-radius: var(
|
|
|
111
111
|
// Border colour properties.
|
|
112
112
|
$input-border-color: var(
|
|
113
113
|
--#{defaults.$prefix}-input-border-color,
|
|
114
|
-
#{theme
|
|
114
|
+
#{theme.get(secondary, 700)}
|
|
115
115
|
);
|
|
116
116
|
$input-disabled-border-color: var(
|
|
117
117
|
--#{defaults.$prefix}-input-disabled-border-color,
|
|
118
|
-
#{theme
|
|
118
|
+
#{theme.get(secondary, 200)}
|
|
119
119
|
);
|
|
120
120
|
$fieldset-border-color: var(
|
|
121
121
|
--#{defaults.$prefix}-fieldset-border-color,
|
|
@@ -129,5 +129,5 @@ $fieldset-disabled-border-color: var(
|
|
|
129
129
|
// Accent color properties.
|
|
130
130
|
$input-accent-color: var(
|
|
131
131
|
--#{defaults.$prefix}-input-accent-color,
|
|
132
|
-
#{theme
|
|
132
|
+
#{theme.get(primary, 700)}
|
|
133
133
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
3
|
@use "../../variables" as base;
|
|
4
|
-
@use "../../theme/variables" as theme;
|
|
5
4
|
@use "defaults";
|
|
5
|
+
@use "../../functions/theme";
|
|
6
6
|
|
|
7
7
|
// Link properties.
|
|
8
8
|
$link-text-decoration: var(
|
|
@@ -13,19 +13,16 @@ $link-text-decoration-thickness: var(
|
|
|
13
13
|
--#{defaults.$prefix}-link-text-decoration-thickness,
|
|
14
14
|
#{base.$border-width}
|
|
15
15
|
);
|
|
16
|
-
$link-color: var(
|
|
17
|
-
--#{defaults.$prefix}-link-color,
|
|
18
|
-
#{theme.$theme-active--primary}
|
|
19
|
-
);
|
|
16
|
+
$link-color: var(--#{defaults.$prefix}-link-color, #{theme.get(primary, 700)});
|
|
20
17
|
$link-hover-color: var(
|
|
21
18
|
--#{defaults.$prefix}-link-hover-color,
|
|
22
|
-
#{theme
|
|
19
|
+
#{theme.get(tertiary, 700)}
|
|
23
20
|
);
|
|
24
21
|
$link-active-color: var(
|
|
25
22
|
--#{defaults.$prefix}-link-active-color,
|
|
26
|
-
#{theme
|
|
23
|
+
#{theme.get(tertiary, 700)}
|
|
27
24
|
);
|
|
28
25
|
$link-visited-color: var(
|
|
29
26
|
--#{defaults.$prefix}-link-visited-color,
|
|
30
|
-
#{theme
|
|
27
|
+
#{theme.get(primary, 700)}
|
|
31
28
|
);
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
@use "../../theme/variables" as theme;
|
|
5
5
|
@use "variables" as *;
|
|
6
6
|
@use "../../mixins/layer" as *;
|
|
7
|
+
@use "../../mixins/media-queries" as *;
|
|
8
|
+
@use "sass:map";
|
|
7
9
|
|
|
8
10
|
@include layer(component) {
|
|
9
11
|
.button {
|
|
@@ -27,6 +29,29 @@
|
|
|
27
29
|
&:active {
|
|
28
30
|
transform: $button-active-transform;
|
|
29
31
|
}
|
|
32
|
+
|
|
33
|
+
&:disabled {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
|
|
36
|
+
&:hover,
|
|
37
|
+
&:active {
|
|
38
|
+
transform: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include animation-off {
|
|
44
|
+
.button {
|
|
45
|
+
transition: $button-transition-reduced-motion;
|
|
46
|
+
|
|
47
|
+
&:hover {
|
|
48
|
+
transform: $button-hover-transform-reduced-motion;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:active {
|
|
52
|
+
transform: $button-active-transform-reduced-motion;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
30
55
|
}
|
|
31
56
|
}
|
|
32
57
|
|
|
@@ -48,28 +73,31 @@
|
|
|
48
73
|
color: $button-active-color;
|
|
49
74
|
}
|
|
50
75
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
--#{defaults.$prefix}-button-hover-border-color: #{theme.$theme-active--primary};
|
|
56
|
-
--#{defaults.$prefix}-button-active-border-color: #{theme.$theme-active--primary};
|
|
57
|
-
}
|
|
76
|
+
&:disabled {
|
|
77
|
+
border-color: $button-disabled-border-color;
|
|
78
|
+
background: $button-disabled-background;
|
|
79
|
+
color: $button-disabled-color;
|
|
58
80
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
81
|
+
&:hover,
|
|
82
|
+
&:active {
|
|
83
|
+
border-color: $button-disabled-border-color;
|
|
84
|
+
background: $button-disabled-background;
|
|
85
|
+
color: $button-disabled-color;
|
|
86
|
+
}
|
|
65
87
|
}
|
|
66
88
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
89
|
+
@each $color, $map in theme.$theme-active {
|
|
90
|
+
&.#{$color} {
|
|
91
|
+
--#{defaults.$prefix}-button-hover-background: #{map.get($map, 700)};
|
|
92
|
+
--#{defaults.$prefix}-button-active-background: #{map.get($map, 700)};
|
|
93
|
+
--#{defaults.$prefix}-button-border-color: #{map.get($map, 700)};
|
|
94
|
+
--#{defaults.$prefix}-button-hover-border-color: #{map.get($map, 700)};
|
|
95
|
+
--#{defaults.$prefix}-button-active-border-color: #{map.get($map, 700)};
|
|
96
|
+
--#{defaults.$prefix}-button-disabled-border-color: #{map.get(
|
|
97
|
+
$map,
|
|
98
|
+
200
|
|
99
|
+
)};
|
|
100
|
+
}
|
|
73
101
|
}
|
|
74
102
|
}
|
|
75
103
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Variables referencing custom properties.
|
|
2
2
|
|
|
3
3
|
@use "../../variables" as base;
|
|
4
|
-
@use "../../theme/variables" as theme;
|
|
5
4
|
@use "defaults";
|
|
6
5
|
@use "sass:map";
|
|
6
|
+
@use "../../functions/theme";
|
|
7
7
|
|
|
8
8
|
// Button properties.
|
|
9
9
|
$button-min-width: var(
|
|
@@ -34,6 +34,12 @@ $button-transition: var(
|
|
|
34
34
|
border-color #{map.get(base.$transition-duration, fast)} #{base.$transition-timing-function},
|
|
35
35
|
transform #{map.get(base.$transition-duration, fast)} #{base.$transition-timing-function}
|
|
36
36
|
);
|
|
37
|
+
$button-transition-reduced-motion: var(
|
|
38
|
+
--#{defaults.$prefix}-button-transition-reduced-motion,
|
|
39
|
+
background #{map.get(base.$transition-duration, none)} #{base.$transition-timing-function},
|
|
40
|
+
color #{map.get(base.$transition-duration, none)} #{base.$transition-timing-function},
|
|
41
|
+
border-color #{map.get(base.$transition-duration, none)} #{base.$transition-timing-function}
|
|
42
|
+
);
|
|
37
43
|
|
|
38
44
|
// Transform properties.
|
|
39
45
|
$button-hover-transform: var(
|
|
@@ -44,33 +50,49 @@ $button-active-transform: var(
|
|
|
44
50
|
--#{defaults.$prefix}-button-active-transform,
|
|
45
51
|
#{defaults.$button-active-transform}
|
|
46
52
|
);
|
|
53
|
+
$button-hover-transform-reduced-motion: var(
|
|
54
|
+
--#{defaults.$prefix}-button-hover-transform-reduced-motion,
|
|
55
|
+
#{defaults.$button-hover-transform-reduced-motion}
|
|
56
|
+
);
|
|
57
|
+
$button-active-transform-reduced-motion: var(
|
|
58
|
+
--#{defaults.$prefix}-button-active-transform-reduced-motion,
|
|
59
|
+
#{defaults.$button-active-transform-reduced-motion}
|
|
60
|
+
);
|
|
47
61
|
|
|
48
62
|
// Background properties.
|
|
49
63
|
$button-background: var(
|
|
50
64
|
--#{defaults.$prefix}-button-background,
|
|
51
|
-
#{theme
|
|
65
|
+
#{theme.get(primary, 100)}
|
|
52
66
|
);
|
|
53
67
|
$button-hover-background: var(
|
|
54
68
|
--#{defaults.$prefix}-button-hover-background,
|
|
55
|
-
#{theme
|
|
69
|
+
#{theme.get(primary, 900)}
|
|
56
70
|
);
|
|
57
71
|
$button-active-background: var(
|
|
58
72
|
--#{defaults.$prefix}-button-active-background,
|
|
59
|
-
#{theme
|
|
73
|
+
#{theme.get(primary, 900)}
|
|
74
|
+
);
|
|
75
|
+
$button-disabled-background: var(
|
|
76
|
+
--#{defaults.$prefix}-button-disabled-background,
|
|
77
|
+
#{theme.get(primary, 100)}
|
|
60
78
|
);
|
|
61
79
|
|
|
62
80
|
// Text properties.
|
|
63
81
|
$button-color: var(
|
|
64
82
|
--#{defaults.$prefix}-button-color,
|
|
65
|
-
#{theme
|
|
83
|
+
#{theme.get(primary, 900)}
|
|
66
84
|
);
|
|
67
85
|
$button-hover-color: var(
|
|
68
86
|
--#{defaults.$prefix}-button-hover-color,
|
|
69
|
-
#{theme
|
|
87
|
+
#{theme.get(primary, 100)}
|
|
70
88
|
);
|
|
71
89
|
$button-active-color: var(
|
|
72
90
|
--#{defaults.$prefix}-button-active-color,
|
|
73
|
-
#{theme
|
|
91
|
+
#{theme.get(primary, 100)}
|
|
92
|
+
);
|
|
93
|
+
$button-disabled-color: var(
|
|
94
|
+
--#{defaults.$prefix}-button-disabled-color,
|
|
95
|
+
#{theme.get(primary, 200)}
|
|
74
96
|
);
|
|
75
97
|
|
|
76
98
|
// Border properties.
|
|
@@ -90,13 +112,17 @@ $button-border-radius: var(
|
|
|
90
112
|
// Border colour properties.
|
|
91
113
|
$button-border-color: var(
|
|
92
114
|
--#{defaults.$prefix}-button-border-color,
|
|
93
|
-
#{theme
|
|
115
|
+
#{theme.get(primary, 900)}
|
|
94
116
|
);
|
|
95
117
|
$button-hover-border-color: var(
|
|
96
118
|
--#{defaults.$prefix}-button-hover-border-color,
|
|
97
|
-
#{theme
|
|
119
|
+
#{theme.get(primary, 900)}
|
|
98
120
|
);
|
|
99
121
|
$button-active-border-color: var(
|
|
100
122
|
--#{defaults.$prefix}-button-active-border-color,
|
|
101
|
-
#{theme
|
|
123
|
+
#{theme.get(primary, 900)}
|
|
124
|
+
);
|
|
125
|
+
$button-disabled-border-color: var(
|
|
126
|
+
--#{defaults.$prefix}-button-disabled-border-color,
|
|
127
|
+
#{theme.get(primary, 200)}
|
|
102
128
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// A function to get the specific theme shades.
|
|
2
|
+
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "../theme/variables" as theme;
|
|
5
|
+
|
|
6
|
+
@function get($color, $shade) {
|
|
7
|
+
$color-map: map.get(theme.$theme-active, $color);
|
|
8
|
+
$value: map.get($color-map, $shade);
|
|
9
|
+
|
|
10
|
+
@return $value;
|
|
11
|
+
}
|
package/scss/graupl.scss
CHANGED