@miljodirektoratet/md-css 1.4.2 → 2.0.0
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/package.json
CHANGED
|
@@ -7,18 +7,18 @@ Class names in brackets [] are optional-/togglable-/decorator- or state dependan
|
|
|
7
7
|
See [Storybook](https://miljodir.github.io/md-components) for examples and more info.
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
<div className="md-radiobutton [md-checkbox--disabled]">
|
|
11
|
+
<span className="md-radiobutton__check-area">
|
|
12
|
+
<span className="md-radiobutton__selected-dot" />
|
|
13
|
+
</span>
|
|
14
|
+
<input
|
|
15
|
+
id="{radioGroupId}"
|
|
16
|
+
type="radio"
|
|
17
|
+
value="{value}"
|
|
18
|
+
checked="{true|false}"
|
|
19
|
+
disabled="{disabled}"
|
|
20
|
+
{...otherProps}
|
|
21
|
+
/>
|
|
22
|
+
<label>{label}</label>
|
|
23
|
+
</div>
|
|
24
24
|
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Structure
|
|
2
|
+
|
|
3
|
+
To use the `Button` css in `@miljodirektoratet/md-css` as a standalone, without the accompanying React component, please use the following HTML structure.
|
|
4
|
+
|
|
5
|
+
Class names and elements in brackets [] are optional-/togglable-/decorator- or state dependant classes.
|
|
6
|
+
|
|
7
|
+
See [Storybook](https://miljodir.github.io/md-components) for examples and more info.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<button className="md-icon-button [md-icon-button--border, md-icon-button--plain]">
|
|
11
|
+
<div className="md-icon-button__icon">
|
|
12
|
+
ICON
|
|
13
|
+
</div>
|
|
14
|
+
</button>
|
|
15
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.md-icon-button {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 32px;
|
|
6
|
+
height: 32px;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
background-color: var(--mdPrimaryColor);
|
|
9
|
+
color: #ffffff;
|
|
10
|
+
font-family: 'Open sans';
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
border: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.md-icon-button__icon {
|
|
16
|
+
margin-top: -1px;
|
|
17
|
+
height: 20px;
|
|
18
|
+
width: 20px;
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.md-icon-button:focus {
|
|
23
|
+
outline: 2px white solid;
|
|
24
|
+
background-color: var(--mdPrimaryColor80);
|
|
25
|
+
outline-offset: -3px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.md-icon-button:hover {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
background-color: var(--mdPrimaryColor120);
|
|
31
|
+
border-color: var(--mdPrimaryColor120);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.md-icon-button[disabled],
|
|
35
|
+
.md-icon-button:disabled {
|
|
36
|
+
background-color: var(--mdGreyColor20);
|
|
37
|
+
color: var(--mdGreyColor60);
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.md-icon-button--border {
|
|
42
|
+
background-color: #ffffff;
|
|
43
|
+
outline: 2px solid var(--mdPrimaryColor);
|
|
44
|
+
outline-offset: -2px;
|
|
45
|
+
color: var(--mdPrimaryColor);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.md-icon-button--border:hover:enabled {
|
|
49
|
+
background-color: var(--mdPrimaryColor20);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.md-icon-button--border:hover:focus:enabled {
|
|
53
|
+
background-color: var(--mdPrimaryColor20);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.md-icon-button--border:focus:enabled {
|
|
57
|
+
background-color: #ffffff;
|
|
58
|
+
border: 1px solid var(--mdPrimaryColor80);
|
|
59
|
+
outline: 1px var(--mdPrimaryColor80) solid;
|
|
60
|
+
outline-offset: -4px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.md-icon-button--border:disabled {
|
|
64
|
+
background-color: var(--mdGreyColor20);
|
|
65
|
+
color: var(--mdGreyColor60);
|
|
66
|
+
outline: 1px solid var(--mdGreyColor60);
|
|
67
|
+
outline-offset: -1px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.md-icon-button--plain {
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
border: none;
|
|
73
|
+
color: var(--mdPrimaryColor);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.md-icon-button--plain:hover:enabled {
|
|
77
|
+
text-decoration: underline;
|
|
78
|
+
outline: black solid 1px;
|
|
79
|
+
outline-offset: -2px;
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.md-icon-button--plain:focus:enabled {
|
|
84
|
+
outline: 2px var(--mdPrimaryColor80) solid;
|
|
85
|
+
outline-offset: -2px;
|
|
86
|
+
background-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.md-icon-button--plain:disabled {
|
|
90
|
+
background-color: transparent;
|
|
91
|
+
outline: none;
|
|
92
|
+
color: var(--mdGreyColor60);
|
|
93
|
+
}
|