@miljodirektoratet/md-css 1.1.3 → 1.2.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miljodirektoratet/md-css",
3
- "version": "1.1.3",
3
+ "version": "1.2.1",
4
4
  "description": "CSS for Miljødirektoratet",
5
5
  "author": "Miljødirektoratet",
6
6
  "main": "./src/index.css",
package/src/index.css CHANGED
@@ -13,6 +13,7 @@
13
13
  @import './tabs/tabs.css';
14
14
  @import './loadingSpinner/loadingSpinner.css';
15
15
  @import './infoTag/infoTag.css';
16
+ @import './tooltip/tooltip.css';
16
17
  @import './messages/alertMessage.css';
17
18
  @import './formElements/input/input.css';
18
19
  @import './formElements/checkbox/checkbox.css';
@@ -1,6 +1,6 @@
1
1
  # Structure
2
2
 
3
- To use the `InfoTags` css in `@miljodirektoratet/md-css` as a standalone, without the accompanying React component, please use the following HTML structure.
3
+ To use the `InfoTag` css in `@miljodirektoratet/md-css` as a standalone, without the accompanying React component, please use the following HTML structure.
4
4
 
5
5
  Class names in brackets [] are optional-/togglable-/decorator- or state dependant classes.
6
6
 
@@ -0,0 +1,22 @@
1
+ # Structure
2
+
3
+ To use the `Tooltip` css in `@miljodirektoratet/md-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
+ ```html
10
+ <div>
11
+ <div className="md-tooltip__child">{children}</div>
12
+ <div
13
+ className="md-tooltip [md-tooltip--show,
14
+ md-tooltip--bottom,
15
+ md-tooltip--top,
16
+ md-tooltip--right,
17
+ md-tooltip--left]"
18
+ >
19
+ {label}
20
+ </div>
21
+ </div>
22
+ ```
@@ -0,0 +1,42 @@
1
+ .md-tooltip {
2
+ background-color: white;
3
+ visibility: hidden;
4
+ box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
5
+ border: 1px solid var(--mdPrimaryColor);
6
+ font-family: 'Open Sans';
7
+ height: fit-content;
8
+ width: fit-content;
9
+ position: absolute;
10
+ z-index: 99;
11
+ font-weight: 400;
12
+ font-size: 14px;
13
+ border-radius: 8px;
14
+ padding: 10px;
15
+ }
16
+
17
+ .md-tooltip--show {
18
+ visibility: visible;
19
+ }
20
+
21
+ .md-tooltip--bottom {
22
+ transform: translate(-35%, 12.8px);
23
+ }
24
+
25
+ .md-tooltip--right {
26
+ transform: translate(2.3em, -32px);
27
+ }
28
+
29
+ .md-tooltip--left {
30
+ transform: translate(calc(-100% - 12.8px), -32px);
31
+ }
32
+
33
+ .md-tooltip--top {
34
+ transform: translate(-35%, calc(-100% - 2.3em));
35
+ }
36
+
37
+ .md-tooltip__child {
38
+ display: flex;
39
+ cursor: pointer;
40
+ }
41
+
42
+