@internetstiftelsen/styleguide 3.0.7 → 3.0.9

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": "@internetstiftelsen/styleguide",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@frctl/fractal": "^1.5.14",
45
- "@frctl/mandelbrot": "^1.10.2",
45
+ "@frctl/mandelbrot": "^1.10.3",
46
46
  "@internetstiftelsen/eslint-config": "^0.0.5",
47
47
  "@internetstiftelsen/stylelint-config": "^1.0.0",
48
48
  "babel-cli": "^6.26.0",
@@ -96,7 +96,7 @@
96
96
  }
97
97
  }
98
98
 
99
- @keyframes pulse {
99
+ @keyframes xPulse {
100
100
  0% {
101
101
  right: 0;
102
102
  opacity: 1;
@@ -245,7 +245,7 @@
245
245
  right: rhythm(3);
246
246
  width: rhythm(7);
247
247
  height: 0;
248
- animation: pulse 2s infinite;
248
+ animation: xPulse 2s infinite;
249
249
  font-family: $font-family-mono;
250
250
  font-size: 80%;
251
251
  text-transform: uppercase;
@@ -257,7 +257,7 @@
257
257
  z-index: z_index(background);
258
258
  top: -#{rem(4px)};
259
259
  right: 0;
260
- animation: pulse 2s infinite;
260
+ animation: xPulse 2s infinite;
261
261
  font-family: $font-family-mono;
262
262
  }
263
263
  }
@@ -39,6 +39,34 @@
39
39
  padding-bottom: rhythm(10);
40
40
  }
41
41
  }
42
+
43
+ @include e(button) {
44
+ position: absolute;
45
+ bottom: 0;
46
+ transform: translateY(50%);
47
+
48
+ @extend %box-shadow;
49
+ }
50
+
51
+ @include e(text) {
52
+ color: $color-snow;
53
+ margin-left: rhythm(4);
54
+ transition: opacity 0.25s ease;
55
+ overflow: hidden;
56
+ opacity: 1;
57
+
58
+ &.is-minimized {
59
+ opacity: 0;
60
+ }
61
+
62
+ @include bp-up(md) {
63
+ max-width: 60%;
64
+ }
65
+
66
+ @include bp-up(lg) {
67
+ max-width: 60%;
68
+ }
69
+ }
42
70
  }
43
71
 
44
72
  @include e(gauge) {
@@ -110,32 +138,4 @@
110
138
  left: -#{rem(20px)};
111
139
  }
112
140
  }
113
-
114
- @include e(button) {
115
- position: absolute;
116
- bottom: 0;
117
- transform: translateY(50%);
118
-
119
- @extend %box-shadow;
120
- }
121
-
122
- @include e(text) {
123
- color: $color-snow;
124
- margin-left: rhythm(4);
125
- transition: opacity 0.25s ease;
126
- overflow: hidden;
127
- opacity: 1;
128
-
129
- &.is-minimized {
130
- opacity: 0;
131
- }
132
-
133
- @include bp-up(md) {
134
- max-width: 60%;
135
- }
136
-
137
- @include bp-up(lg) {
138
- max-width: 60%;
139
- }
140
- }
141
141
  }
@@ -62,10 +62,16 @@
62
62
  }
63
63
 
64
64
  @include e(paragraph) {
65
+ color: $color-cyberspace;
66
+
65
67
  @include plumber(
66
68
  $font-size: 2.5,
67
69
  $line-height: 3
68
70
  );
71
+
72
+ @include bp-up(sm) {
73
+ color: $color-snow;
74
+ }
69
75
  }
70
76
 
71
77
  @include e(tags) {
@@ -196,6 +202,10 @@
196
202
  }
197
203
  }
198
204
 
205
+ @include e(paragraph) {
206
+ color: $color-cyberspace;
207
+ }
208
+
199
209
  &.alignfull {
200
210
  @include e(caption) {
201
211
  .wrapper {
@@ -22,7 +22,7 @@ module.exports = {
22
22
  limited_width: true,
23
23
  has_radius: true,
24
24
  has_buttons: false,
25
- text: 'Nästan alla i Sverige använder internet – men hur meningsfull är tiden vi spenderar där? I rapporten Svenskarna och internet 2019 frågar vi för första gången om meningsfullhet, och det syns stora skillnader mellan olika aktiviteter. Tid på sociala medier tycker bara var fjärde är meningsfull.',
25
+ text: 'Nästan alla i Sverige använder internet – men hur meningsfull är tiden vi spenderar där? I rapporten Svenskarna och internet 2019 frågar vi för första gången om meningsfullhet, och det syns stora skillnader mellan olika aktiviteter.',
26
26
  }
27
27
  },
28
28
  {
@@ -0,0 +1,55 @@
1
+ // DUMMY TIMELINE ITEM OPEN/CLOSE
2
+ function wrap(el, wrapper) {
3
+ el.parentNode.insertBefore(wrapper, el);
4
+ wrapper.classList.add('wrapper');
5
+ wrapper.appendChild(el);
6
+ }
7
+
8
+ const timeLineItems = document.querySelectorAll('.js-timeline-item');
9
+ let timeLineItemScrollPosition = 0;
10
+
11
+ [].forEach.call(timeLineItems, (timeLineItem) => {
12
+ const timeLineItemLink = timeLineItem.querySelector('a');
13
+ const timeLineItemClose = timeLineItem.querySelector('.js-timeline-item-close');
14
+ const timeLineItemBottomClose = timeLineItem.querySelector('.js-timeline-item-bottom-close');
15
+
16
+ timeLineItemLink.addEventListener('click', () => {
17
+ timeLineItemScrollPosition = window.pageYOffset;
18
+ sessionStorage.setItem('scroll-position', timeLineItemScrollPosition);
19
+
20
+ if (!timeLineItem.classList.contains('is-open')) {
21
+ timeLineItem.classList.add('is-open');
22
+ timeLineItem.closest('.row')
23
+ .classList
24
+ .add('row-has-open-child');
25
+
26
+ // Wrap open timeline item
27
+ wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'),
28
+ document.createElement('div'));
29
+ }
30
+ });
31
+
32
+ timeLineItemClose.addEventListener('click', () => {
33
+ timeLineItem.classList.remove('is-open');
34
+ timeLineItem.closest('.row')
35
+ .classList
36
+ .remove('row-has-open-child');
37
+
38
+ // Destroy generated wrapper
39
+ const wrapper = timeLineItemClose.nextElementSibling;
40
+ wrapper.replaceWith(...wrapper.childNodes);
41
+
42
+ const top = sessionStorage.getItem('scroll-position');
43
+ if (top !== null) {
44
+ window.scrollTo(0, parseInt(top, 10));
45
+ }
46
+ sessionStorage.removeItem('scroll-position');
47
+
48
+ // Trigger scroll event to reveal timeline items not yet parallaxed into view
49
+ window.dispatchEvent(new CustomEvent('scroll'));
50
+ });
51
+
52
+ timeLineItemBottomClose.addEventListener('click', () => {
53
+ timeLineItemClose.click();
54
+ });
55
+ });
@@ -137,55 +137,3 @@ if (progressBar) {
137
137
  decadeIsVisible();
138
138
  });
139
139
  }
140
-
141
- // DUMMY TIMELINE ITEM OPEN/CLOSE
142
- // function wrap(el, wrapper) {
143
- // el.parentNode.insertBefore(wrapper, el);
144
- // wrapper.classList.add('wrapper');
145
- // wrapper.appendChild(el);
146
- // }
147
- //
148
- // const timeLineItems = document.querySelectorAll('.js-timeline-item');
149
- // let timeLineItemScrollPosition = 0;
150
- //
151
- // [].forEach.call(timeLineItems, (timeLineItem) => {
152
- // const timeLineItemLink = timeLineItem.querySelector('a');
153
- // const timeLineItemClose = timeLineItem.querySelector('.js-timeline-item-close');
154
- // const timeLineItemBottomClose = timeLineItem.querySelector('.js-timeline-item-bottom-close');
155
- //
156
- // timeLineItemLink.addEventListener('click', () => {
157
- // timeLineItemScrollPosition = window.pageYOffset;
158
- // sessionStorage.setItem('scroll-position', timeLineItemScrollPosition);
159
- //
160
- // if (!timeLineItem.classList.contains('is-open')) {
161
- // timeLineItem.classList.add('is-open');
162
- // timeLineItem.closest('.row').classList.add('row-has-open-child');
163
- //
164
- // // Wrap open timeline item
165
- // wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'),
166
- // document.createElement('div'));
167
- // }
168
- // });
169
- //
170
- // timeLineItemClose.addEventListener('click', () => {
171
- // timeLineItem.classList.remove('is-open');
172
- // timeLineItem.closest('.row').classList.remove('row-has-open-child');
173
- //
174
- // // Destroy generated wrapper
175
- // const wrapper = timeLineItemClose.nextElementSibling;
176
- // wrapper.replaceWith(...wrapper.childNodes);
177
- //
178
- // const top = sessionStorage.getItem('scroll-position');
179
- // if (top !== null) {
180
- // window.scrollTo(0, parseInt(top, 10));
181
- // }
182
- // sessionStorage.removeItem('scroll-position');
183
- //
184
- // // Trigger scroll event to reveal timeline items not yet parallaxed into view
185
- // window.dispatchEvent(new CustomEvent('scroll'));
186
- // });
187
- //
188
- // timeLineItemBottomClose.addEventListener('click', () => {
189
- // timeLineItemClose.click();
190
- // });
191
- // });