|
1 |
| -// Class prefix |
2 |
| -$classPrefix: jvm- !default; |
3 |
| -$border-color: #e5e7eb !default; |
4 |
| -$box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !default; |
| 1 | +@import './variables'; |
| 2 | + |
| 3 | +:root { |
| 4 | + --jvm-border-color: #{$border-color}; |
| 5 | + --jvm-box-shadow: #{$box-shadow}; |
| 6 | + |
| 7 | + // Tooltip |
| 8 | + --jvm-tooltip-shadow: var(--jvm-box-shadow); |
| 9 | + --jvm-tooltip-font-family: #{$tooltip-font-family}; |
| 10 | + --jvm-tooltip-bg-color: #{$tooltip-bg-color}; |
| 11 | + --jvm-tooltip-color: #{$tooltip-color}; |
| 12 | + --jvm-tooltip-radius: #{$tooltip-radius}; |
| 13 | + --jvm-tooltip-font-size: #{$tooltip-font-size}; |
| 14 | + --jvm-tooltip-padding: #{$tooltip-padding}; |
| 15 | + |
| 16 | + // Zoom buttons |
| 17 | + --jvm-zoom-btns-bg-color: #{$zoom-btns-bg-color}; |
| 18 | + --jvm-zoom-btns-color: #{$zoom-btns-color}; |
| 19 | + --jvm-zoom-btns-radius: #{$zoom-btns-radius}; |
| 20 | + --jvm-zoom-btns-height: #{$zoom-btns-height}; |
| 21 | + --jvm-zoom-btns-padding: #{$zoom-btns-padding}; |
| 22 | + --jvm-zoom-btns-width: #{$zoom-btns-width}; |
| 23 | + |
| 24 | + // Series |
| 25 | + --jvm-series-container-right: #{$series-container-right}; |
5 | 26 |
|
6 |
| -// Tooltip |
7 |
| -$tooltip-shadow: 1px 2px 12px rgba(0, 0, 0, .2) !default; |
8 |
| -$tooltip-font-family: sans-serif, Verdana !default; |
9 |
| -$tooltip-bg-color: #5c5cff !default; |
10 |
| -$tooltip-radius: 3px !default; |
11 |
| -$tooltip-font-size: smaller !default; |
12 |
| -$tooltip-padding: 3px 5px !default; |
13 |
| - |
14 |
| -// Zoom buttons |
15 |
| -$zoom-btns-bg-color: #292929 !default; |
16 |
| -$zoom-btns-radius: 3px !default; |
17 |
| -$zoom-btns-height: 15px !default; |
18 |
| -$zoom-btns-padding: 3px !default; |
19 |
| -$zoom-btns-width: 15px !default; |
20 |
| - |
21 |
| -// Series |
22 |
| -$series-container-right: 15px !default; |
23 |
| - |
24 |
| -// Legends |
25 |
| -$legend-background-color: #FFF !default; |
26 |
| -$legend-radius: 0.25rem !default; |
27 |
| -$legend-margin-left: .75rem !default; |
28 |
| -$legend-padding: 0.6rem !default; |
29 |
| - |
30 |
| -// Legend title |
31 |
| -$legend-title-padding-bottom: 0.5rem !default; |
32 |
| -$legend-title-margin-bottom: 0.575rem !default; |
33 |
| - |
34 |
| -// Legend ticks |
35 |
| -$legend-tick-margin-top: .575rem !default; |
36 |
| -$legend-tick-sample-radius: 4px !default; |
37 |
| -$legend-tick-sample-height: 16px !default; |
38 |
| -$legend-tick-sample-width: 16px !default; |
39 |
| -$legend-tick-text-font-size: 12px !default; |
40 |
| -$legend-tick-text-margin-top: 3px !default; |
| 27 | + // Legends |
| 28 | + --jvm-legend-background-color: #{$legend-background-color}; |
| 29 | + --jvm-legend-radius: #{$legend-radius}; |
| 30 | + --jvm-legend-margin-left: #{$legend-margin-left}; |
| 31 | + --jvm-legend-padding: #{$legend-padding}; |
| 32 | + |
| 33 | + // Legend title |
| 34 | + --jvm-legend-title-padding-bottom: #{$legend-title-padding-bottom}; |
| 35 | + --jvm-legend-title-margin-bottom: #{$legend-title-margin-bottom}; |
| 36 | + |
| 37 | + // Legend ticks |
| 38 | + --jvm-legend-tick-margin-top: #{$legend-tick-margin-top}; |
| 39 | + --jvm-legend-tick-sample-radius: #{$legend-tick-sample-radius}; |
| 40 | + --jvm-legend-tick-sample-height: #{$legend-tick-sample-height}; |
| 41 | + --jvm-legend-tick-sample-width: #{$legend-tick-sample-width}; |
| 42 | + --jvm-legend-tick-text-font-size: #{$legend-tick-text-font-size}; |
| 43 | + --jvm-legend-tick-text-margin-top: #{$legend-tick-text-margin-top}; |
| 44 | +} |
41 | 45 |
|
42 | 46 | // Global resets
|
43 |
| -image, text, .#{$classPrefix}zoomin, .#{$classPrefix}zoomout { user-select: none } |
| 47 | +image, text, .jvm-zoom-btn { user-select: none } |
44 | 48 |
|
45 | 49 | // jsVectorMap container
|
46 |
| -.#{$classPrefix}container { |
| 50 | +.jvm-container { |
47 | 51 | position: relative;
|
48 | 52 | overflow: hidden;
|
49 | 53 | height: 100%;
|
50 | 54 | width: 100%;
|
51 | 55 | }
|
52 | 56 |
|
53 | 57 | // Tooltip
|
54 |
| -.#{$classPrefix}tooltip { |
55 |
| - border-radius: $tooltip-radius; |
56 |
| - background-color: $tooltip-bg-color; |
57 |
| - font-family: $tooltip-font-family; |
58 |
| - font-size: $tooltip-font-size; |
59 |
| - box-shadow: $tooltip-shadow; |
60 |
| - padding: $tooltip-padding; |
| 58 | +.jvm-tooltip { |
| 59 | + border-radius: var(--jvm-tooltip-radius); |
| 60 | + background-color: var(--jvm-tooltip-bg-color); |
| 61 | + color: var(--jvm-tooltip-color); |
| 62 | + font-family: var(--jvm-tooltip-font-family); |
| 63 | + font-size: var(--jvm-tooltip-font-size); |
| 64 | + box-shadow: var(--jvm-tooltip-shadow); |
| 65 | + padding: var(--jvm-tooltip-padding); |
61 | 66 | white-space: nowrap;
|
62 | 67 | position: absolute;
|
63 | 68 | display: none;
|
64 |
| - color: #FFF; |
65 | 69 | &.active {
|
66 | 70 | display: block;
|
67 | 71 | }
|
68 | 72 | }
|
69 | 73 |
|
70 | 74 | // Zoom buttons
|
71 |
| -.#{$classPrefix}zoom-btn { |
72 |
| - border-radius: $zoom-btns-radius; |
73 |
| - background-color: $zoom-btns-bg-color; |
74 |
| - padding: $zoom-btns-padding; |
| 75 | +.jvm-zoom-btn { |
| 76 | + border-radius: var(--jvm-zoom-btns-radius); |
| 77 | + background-color: var(--jvm-zoom-btns-bg-color); |
| 78 | + padding: var(--jvm-zoom-btns-padding); |
| 79 | + color: var(--jvm-zoom-btns-color); |
75 | 80 | box-sizing: border-box;
|
76 | 81 | position: absolute;
|
77 | 82 | line-height: 10px;
|
78 | 83 | cursor: pointer;
|
79 |
| - color: #FFF; |
80 | 84 | height: 15px;
|
81 | 85 | width: 15px;
|
82 | 86 | left: 10px;
|
83 | 87 |
|
84 |
| - &.#{$classPrefix}zoomout { |
| 88 | + &.jvm-zoomout { |
85 | 89 | top: 30px
|
86 | 90 | }
|
87 | 91 |
|
88 |
| - &.#{$classPrefix}zoomin { |
| 92 | + &.jvm-zoomin { |
89 | 93 | top: 10px
|
90 | 94 | }
|
91 | 95 | }
|
92 | 96 |
|
93 | 97 | // Series
|
94 |
| -.#{$classPrefix}series-container { |
95 |
| - right: $series-container-right; |
| 98 | +.jvm-series-container { |
| 99 | + right: var(--jvm-series-container-right); |
96 | 100 | position: absolute;
|
| 101 | + &.jvm-series-h { bottom: 15px } |
| 102 | + &.jvm-series-v { top: 15px } |
| 103 | +} |
97 | 104 |
|
98 |
| - // horizontal |
99 |
| - &.#{$classPrefix}series-h { bottom: 15px } |
| 105 | +// Legends |
| 106 | +.jvm-legend { |
| 107 | + background-color: var(--jvm-legend-background-color); |
| 108 | + border: 1px solid var(--jvm-border-color); |
| 109 | + margin-left: var(--jvm-legend-margin-left); |
| 110 | + border-radius: var(--jvm-legend-radius); |
| 111 | + padding: var(--jvm-legend-padding); |
| 112 | + box-shadow: var(--jvm-box-shadow); |
| 113 | +} |
100 | 114 |
|
101 |
| - // Vertical |
102 |
| - &.#{$classPrefix}series-v { top: 15px } |
| 115 | +.jvm-legend-title { |
| 116 | + line-height: 1; |
| 117 | + border-bottom: 1px solid var(--jvm-border-color); |
| 118 | + padding-bottom: var(--jvm-legend-title-padding-bottom); |
| 119 | + margin-bottom: var(--jvm-legend-title-margin-bottom); |
| 120 | + text-align: left; |
| 121 | +} |
103 | 122 |
|
104 |
| - // Legends |
105 |
| - .#{$classPrefix}legend { |
106 |
| - background-color: $legend-background-color; |
107 |
| - border: 1px solid $border-color; |
108 |
| - margin-left: $legend-margin-left; |
109 |
| - border-radius: $legend-radius; |
110 |
| - border-color: $border-color; |
111 |
| - padding: $legend-padding; |
112 |
| - box-shadow: $box-shadow; |
113 |
| - float: left; |
114 |
| - |
115 |
| - .#{$classPrefix}legend-title { |
116 |
| - line-height: 1; |
117 |
| - border-bottom: 1px solid $border-color; |
118 |
| - padding-bottom: $legend-title-padding-bottom; |
119 |
| - margin-bottom: $legend-title-margin-bottom; |
120 |
| - text-align: left; |
121 |
| - } |
122 |
| - |
123 |
| - .#{$classPrefix}legend-inner { |
124 |
| - overflow: hidden; |
125 |
| - |
126 |
| - .#{$classPrefix}legend-tick { |
127 |
| - overflow: hidden; |
128 |
| - min-width: 40px; |
129 |
| - &:not(:first-child) { |
130 |
| - margin-top: $legend-tick-margin-top; |
131 |
| - } |
132 |
| - |
133 |
| - .#{$classPrefix}legend-tick-sample { |
134 |
| - border-radius: $legend-tick-sample-radius; |
135 |
| - margin-right: .65rem; |
136 |
| - height: $legend-tick-sample-height; |
137 |
| - width: $legend-tick-sample-width; |
138 |
| - float: left; |
139 |
| - } |
140 |
| - |
141 |
| - .#{$classPrefix}legend-tick-text { |
142 |
| - font-size: $legend-tick-text-font-size; |
143 |
| - text-align: center; |
144 |
| - float: left; |
145 |
| - } |
146 |
| - } |
147 |
| - } |
| 123 | +.jvm-legend-tick { |
| 124 | + display: flex; |
| 125 | + min-width: 40px; |
| 126 | + &:not(:first-child) { |
| 127 | + margin-top: var(--jvm-legend-tick-margin-top); |
148 | 128 | }
|
149 | 129 | }
|
150 | 130 |
|
| 131 | +.jvm-legend-tick-sample { |
| 132 | + border-radius: var(--jvm-legend-tick-sample-radius); |
| 133 | + margin-right: .65rem; |
| 134 | + height: var(--jvm-legend-tick-sample-height); |
| 135 | + width: var(--jvm-legend-tick-sample-width); |
| 136 | +} |
| 137 | + |
| 138 | +.jvm-legend-tick-text { |
| 139 | + font-size: var(--jvm-legend-tick-text-font-size); |
| 140 | + text-align: center; |
| 141 | +} |
| 142 | + |
151 | 143 | // Line animation
|
152 | 144 | .jvm-line[animation="true"] {
|
153 | 145 | -webkit-animation: jvm-line-animation 10s linear forwards infinite;
|
|
0 commit comments