@miljodirektoratet/md-css 0.0.14 → 0.0.15
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 +1 -1
- package/src/index.css +1 -0
- package/src/tile/README.md +47 -0
- package/src/tile/tile.css +119 -0
package/package.json
CHANGED
package/src/index.css
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
@import './filelist/filelist.css';
|
|
10
10
|
@import './accordionitem/accordionitem.css';
|
|
11
11
|
@import './modal/modal.css';
|
|
12
|
+
@import './tile/tile.css';
|
|
12
13
|
@import './formElements/input/input.css';
|
|
13
14
|
@import './formElements/checkbox/checkbox.css';
|
|
14
15
|
@import './formElements/checkboxgroup/checkboxgroup.css';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Tiles
|
|
2
|
+
|
|
3
|
+
To use the `Tile` css as a standalone, without the accompanying React component, please use the following HTML structure.
|
|
4
|
+
|
|
5
|
+
Class names 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
|
+
## Tile horizontal
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<a
|
|
13
|
+
className="md-tile"
|
|
14
|
+
href={href}
|
|
15
|
+
onClick={handleClick}
|
|
16
|
+
>
|
|
17
|
+
<div className="md-tile__content">
|
|
18
|
+
<div className="md-tile__content-icon">{icon}</div>
|
|
19
|
+
<div className="md-tile__content-text">
|
|
20
|
+
<div className="md-tile__content-heading">{heading}</div>
|
|
21
|
+
<div className="md-tile__content-description">{description}</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div className="md-tile__arrow">
|
|
26
|
+
<MdChevronIcon height={25} />
|
|
27
|
+
</div>
|
|
28
|
+
</a>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Tile vertical
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<a
|
|
35
|
+
className="md-tile-vertical [md-tile-vertical--small, md-tile-vertical--large]"
|
|
36
|
+
href={href}
|
|
37
|
+
onClick={handleClick}
|
|
38
|
+
>
|
|
39
|
+
<div className="md-tile-vertical__content">
|
|
40
|
+
<div className="md-tile-vertical__content-icon">{icon}</div>
|
|
41
|
+
<div className="md-tile-vertical__content-text">
|
|
42
|
+
<div className="md-tile-vertical__content-heading">{heading}</div>
|
|
43
|
+
<div className="md-tile-vertical__content-description">{description}</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</a>
|
|
47
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* HORIZONTAL TILES */
|
|
2
|
+
.md-tile {
|
|
3
|
+
padding: 1.5em;
|
|
4
|
+
border: 1px solid var(--mdGreyColor60);
|
|
5
|
+
background-color: var(--mdPrimaryColor10);
|
|
6
|
+
color: var(--mdGreyColor);
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
font-family: 'Open sans';
|
|
12
|
+
width: 440px;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
transition: all .15s ease-in-out;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.md-tile:hover {
|
|
18
|
+
border: 1px solid var(--mdPrimaryColor);
|
|
19
|
+
background-color: var(--mdPrimaryColor20);
|
|
20
|
+
transition: all .15s ease-in-out;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.md-tile:focus {
|
|
24
|
+
outline: 2px solid var(--mdPrimaryColor);
|
|
25
|
+
outline-offset: -2px;
|
|
26
|
+
background-color: var(--mdPrimaryColor20);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.md-tile__content {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.md-tile__content-icon {
|
|
35
|
+
margin-right: 1em;
|
|
36
|
+
color: var(--mdPrimaryColor80);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.md-tile__content-heading {
|
|
40
|
+
font-size: 20px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.md-tile__content-description {
|
|
44
|
+
margin-top: 1em;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.md-tile__arrow {
|
|
48
|
+
color: var(--mdGreyColor);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* VERTICAL TILES */
|
|
52
|
+
.md-tile-vertical {
|
|
53
|
+
display: flex;
|
|
54
|
+
width: 190px;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
border: 1px solid var(--mdGreyColor60);
|
|
59
|
+
background-color: var(--mdPrimaryColor10);
|
|
60
|
+
color: var(--mdGreyColor);
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
font-family: 'Open sans';
|
|
63
|
+
transition: all .15s ease-in-out;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.md-tile-vertical--small {
|
|
67
|
+
width: 178px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.md-tile-vertical--large {
|
|
71
|
+
width: 238px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.md-tile-vertical:hover {
|
|
75
|
+
border: 1px solid var(--mdPrimaryColor);
|
|
76
|
+
background-color: var(--mdPrimaryColor20);
|
|
77
|
+
transition: all .15s ease-in-out;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.md-tile-vertical:focus {
|
|
81
|
+
outline: 2px solid var(--mdPrimaryColor);
|
|
82
|
+
outline-offset: -2px;
|
|
83
|
+
background-color: var(--mdPrimaryColor20);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.md-tile-vertical__content {
|
|
87
|
+
width: 100%;
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
padding: 1.5em;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.md-tile-vertical--small .md-tile-vertical__content {
|
|
94
|
+
padding: 1em;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.md-tile-vertical--large .md-tile-vertical__content {
|
|
98
|
+
padding: 2em 1.5em;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.md-tile-vertical__content-text {
|
|
102
|
+
text-align: center;
|
|
103
|
+
word-break: break-all;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.md-tile-vertical__content-icon {
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
margin-bottom: 1em;
|
|
110
|
+
color: var(--mdPrimaryColor80);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.md-tile-vertical__content-heading {
|
|
114
|
+
font-size: 20px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.md-tile-vertical__content-description {
|
|
118
|
+
margin-top: 1em;
|
|
119
|
+
}
|