@phun-ky/speccer 6.0.0 → 6.0.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.
Files changed (61) hide show
  1. package/package.json +7 -1
  2. package/CHANGELOG.md +0 -78
  3. package/dts/browser.d.ts +0 -4
  4. package/dts/enums/area.d.ts +0 -16
  5. package/dts/helpers/dissect/index.d.ts +0 -1
  6. package/dts/helpers/dissect/styles.d.ts +0 -1
  7. package/dts/helpers/typography/index.d.ts +0 -2
  8. package/dts/helpers/typography/position.d.ts +0 -4
  9. package/dts/helpers/typography/template.d.ts +0 -1
  10. package/dts/index.d.ts +0 -53
  11. package/dts/interfaces/global.d.ts +0 -6
  12. package/dts/lib/attributes.d.ts +0 -2
  13. package/dts/lib/classnames.d.ts +0 -4
  14. package/dts/lib/constants.d.ts +0 -3
  15. package/dts/lib/css.d.ts +0 -6
  16. package/dts/lib/debounce.d.ts +0 -3
  17. package/dts/lib/node.d.ts +0 -2
  18. package/dts/lib/number.d.ts +0 -1
  19. package/dts/lib/position.d.ts +0 -6
  20. package/dts/lib/resize.d.ts +0 -1
  21. package/dts/lib/styles.d.ts +0 -2
  22. package/dts/tasks/dissect.d.ts +0 -2
  23. package/dts/tasks/index.d.ts +0 -4
  24. package/dts/tasks/measure.d.ts +0 -1
  25. package/dts/tasks/spec.d.ts +0 -2
  26. package/dts/tasks/typography.d.ts +0 -2
  27. package/dts/types/css.d.ts +0 -19
  28. package/dts/types/speccer.d.ts +0 -5
  29. package/src/browser.ts +0 -96
  30. package/src/enums/area.ts +0 -17
  31. package/src/helpers/dissect/index.ts +0 -1
  32. package/src/helpers/dissect/styles.ts +0 -154
  33. package/src/helpers/typography/index.ts +0 -3
  34. package/src/helpers/typography/position.ts +0 -54
  35. package/src/helpers/typography/template.ts +0 -27
  36. package/src/index.ts +0 -36
  37. package/src/interfaces/global.ts +0 -7
  38. package/src/lib/attributes.ts +0 -18
  39. package/src/lib/classnames.ts +0 -43
  40. package/src/lib/constants.ts +0 -8
  41. package/src/lib/css.ts +0 -45
  42. package/src/lib/debounce.ts +0 -29
  43. package/src/lib/node.ts +0 -8
  44. package/src/lib/number.ts +0 -4
  45. package/src/lib/position.ts +0 -16
  46. package/src/lib/resize.ts +0 -14
  47. package/src/lib/styles.ts +0 -31
  48. package/src/styles/anatomy.styl +0 -274
  49. package/src/styles/index.styl +0 -72
  50. package/src/styles/measure.styl +0 -88
  51. package/src/styles/spacing.styl +0 -142
  52. package/src/styles/typography.styl +0 -85
  53. package/src/tasks/dissect.ts +0 -46
  54. package/src/tasks/index.ts +0 -7
  55. package/src/tasks/measure.ts +0 -82
  56. package/src/tasks/spec.ts +0 -170
  57. package/src/tasks/typography.ts +0 -45
  58. package/src/types/css.ts +0 -20
  59. package/src/types/speccer.ts +0 -6
  60. package/tsconfig.json +0 -21
  61. package/tslint.json +0 -23
package/src/index.ts DELETED
@@ -1,36 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- import './interfaces/global';
5
- import * as __node from './lib/node';
6
- import * as __spacing from './tasks/spec';
7
- import * as __dissect from './tasks/dissect';
8
- import * as __measure from './tasks/measure';
9
- import * as __typography from './tasks/typography';
10
- import * as __browser from './browser';
11
-
12
- export const spacing = __spacing;
13
-
14
- export const dissect = __dissect;
15
-
16
- export const measure = __measure;
17
-
18
- export const typography = __typography;
19
-
20
- const speccer = () => {
21
- __node.removeAll('.speccer');
22
-
23
- const _els_to_be_specced = document.querySelectorAll('[data-speccer],[data-speccer] *:not(td)');
24
- const _els_to_be_measured = document.querySelectorAll('[data-speccer-measure]');
25
- const _els_to_be_typography_specced = document.querySelectorAll('[data-speccer-typography]');
26
- const _els_to_be_dissected = document.querySelectorAll('[data-anatomy-section] [data-anatomy]');
27
-
28
- _els_to_be_specced.forEach(spacing.element);
29
- _els_to_be_measured.forEach(measure.element);
30
- _els_to_be_typography_specced.forEach(typography.element);
31
- _els_to_be_dissected.forEach(dissect.element);
32
- };
33
-
34
- export default speccer;
35
-
36
- __browser.activate(speccer);
@@ -1,7 +0,0 @@
1
- export {};
2
-
3
- declare global {
4
- interface Window {
5
- speccer: any;
6
- }
7
- }
@@ -1,18 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- export const set = (el: HTMLElement, attrs: {}) => {
5
- if (!el) return;
6
-
7
- if (!attrs) return;
8
-
9
- Object.keys(attrs).forEach((key) => el.setAttribute(key, attrs[key]));
10
- };
11
-
12
- export const remove = (el: HTMLElement, attrs: {}) => {
13
- if (!el) return;
14
-
15
- if (!attrs) return;
16
-
17
- Object.keys(attrs).forEach((key) => el.removeAttribute(key));
18
- };
@@ -1,43 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- export const set = (el: HTMLElement, cls: string, avoid = 'noop') => {
5
- if (!el) return;
6
-
7
- if (!cls || (cls && cls.length === 0)) return;
8
-
9
- cls
10
- .trim()
11
- .split(' ')
12
- .filter((cl) => cl !== avoid)
13
- .forEach((cl) => el.classList.add(cl));
14
- };
15
-
16
- export const toggle = (el: HTMLElement, cls: string, avoid = 'noop') => {
17
- if (!el) return;
18
-
19
- if (!cls || (cls && cls.length === 0)) return;
20
-
21
- cls
22
- .trim()
23
- .split(' ')
24
- .filter((cl) => cl !== avoid)
25
- .forEach((cl) => el.classList.toggle(cl));
26
- };
27
-
28
- export const remove = (el: HTMLElement, cls: string, avoid = 'noop') => {
29
- if (!el) return;
30
-
31
- if (!cls || (cls && cls.length === 0)) return;
32
-
33
- cls
34
- .trim()
35
- .split(' ')
36
- .filter((cl) => cl !== avoid)
37
- .forEach((cl) => el.classList.remove(cl));
38
- };
39
-
40
- export const cx = (cls: string, cls_obj: {}): string =>
41
- `${cls} ${Object.keys(cls_obj)
42
- .filter((classname) => cls_obj[classname])
43
- .join(' ')}`.trim();
@@ -1,8 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- export const SPECCER_LITERALS = [...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'];
5
-
6
- export const SPECCER_TAGS_TO_AVOID = ['TR', 'TH', 'TD', 'TBODY', 'THEAD', 'TFOOT'];
7
-
8
- export const SPECCER_DEFAULT_PIN_SPACE = 48;
package/src/lib/css.ts DELETED
@@ -1,45 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
- import { SPECCER_DEFAULT_PIN_SPACE } from './constants';
4
- import { SpacingCSSPropertiesType, TypographyCSSPropertiesType } from '../types/css';
5
-
6
- export const getNumberValue = (value: string): number => parseInt(value, 10);
7
-
8
- export const normalizeNumberValue = (value: string | number): number => {
9
- const _value = parseFloat(value + '');
10
-
11
- return (_value >= 0 && _value < 1) || (_value <= 0 && _value > -1) ? 0 : _value;
12
- };
13
-
14
- export const getSpacing = (style: SpacingCSSPropertiesType): SpacingCSSPropertiesType => {
15
- const { marginTop, marginBottom, marginLeft, marginRight, paddingTop, paddingBottom, paddingLeft, paddingRight } =
16
- style;
17
-
18
- return {
19
- marginTop,
20
- marginBottom,
21
- marginLeft,
22
- marginRight,
23
- paddingTop,
24
- paddingBottom,
25
- paddingLeft,
26
- paddingRight
27
- };
28
- };
29
-
30
- export const getTypography = (style: TypographyCSSPropertiesType): TypographyCSSPropertiesType => {
31
- const { lineHeight, letterSpacing, fontFamily, fontSize, fontStyle, fontVariationSettings, fontWeight } = style;
32
-
33
- return {
34
- lineHeight,
35
- letterSpacing,
36
- fontFamily,
37
- fontSize,
38
- fontStyle,
39
- fontVariationSettings,
40
- fontWeight
41
- };
42
- };
43
-
44
- export const pinSpace = (el: HTMLElement): number =>
45
- getNumberValue(getComputedStyle(el).getPropertyValue('--ph-speccer-pin-space')) || SPECCER_DEFAULT_PIN_SPACE;
@@ -1,29 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- export const waitForFrame = () => new Promise(requestAnimationFrame);
5
-
6
- const debounce = function (func: Function, wait: number, immediate?: boolean): Function {
7
- let timeout: null | ReturnType<typeof setTimeout>;
8
-
9
- return function (this: any) {
10
- const context = this;
11
- const args = arguments;
12
- const later = function () {
13
- timeout = null;
14
-
15
- if (!immediate) func.apply(context, args);
16
- };
17
- const callNow = immediate && !timeout;
18
-
19
- if (timeout) {
20
- clearTimeout(timeout);
21
- }
22
-
23
- timeout = setTimeout(later, wait);
24
-
25
- if (callNow) func.apply(context, args);
26
- };
27
- };
28
-
29
- export default debounce;
package/src/lib/node.ts DELETED
@@ -1,8 +0,0 @@
1
- export const after = (el: HTMLElement | null, newSibling: HTMLElement) =>
2
- el && el.insertAdjacentElement('afterend', newSibling);
3
-
4
- export const removeAll = (selector: string, el: Document = document) => {
5
- [].forEach.call(el.querySelectorAll(selector), function (e: HTMLElement) {
6
- e.remove();
7
- });
8
- };
package/src/lib/number.ts DELETED
@@ -1,4 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- export const decimal = (number: string | number, decimals = 3): string => parseFloat(number + '').toFixed(decimals);
@@ -1,16 +0,0 @@
1
- export const get_horizontal_center_of_els = (modifier: number, startRect: DOMRect, targetRect: DOMRect): number =>
2
- modifier - startRect.width / 2 + targetRect.width / 2;
3
-
4
- export const get_vertical_center_of_els = (modifier: number, startRect: DOMRect, targetRect: DOMRect): number =>
5
- modifier - startRect.height / 2 + targetRect.height / 2;
6
-
7
- export const get_body_correction = () => {
8
- const _body_style = getComputedStyle(document.body);
9
- const _body_left_correction = parseInt(_body_style.paddingLeft) + parseInt(_body_style.marginLeft);
10
- const _body_top_correction = parseInt(_body_style.paddingTop) + parseInt(_body_style.marginTop);
11
-
12
- return {
13
- top: _body_top_correction,
14
- left: _body_left_correction
15
- };
16
- };
package/src/lib/resize.ts DELETED
@@ -1,14 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
-
4
- import debounce from './debounce';
5
-
6
- export const activate = (speccer: Function) => {
7
- const speccerEventFunc = () =>
8
- debounce(() => {
9
- speccer();
10
- }, 300);
11
-
12
- window.removeEventListener('resize', speccerEventFunc);
13
- window.addEventListener('resize', speccerEventFunc);
14
- };
package/src/lib/styles.ts DELETED
@@ -1,31 +0,0 @@
1
- /* eslint no-console:0 */
2
- 'use strict';
3
- import { waitForFrame } from './debounce';
4
-
5
- export const add = async (el: HTMLElement, styles: [] | object) => {
6
- if (
7
- !el ||
8
- !styles ||
9
- typeof styles === 'string' ||
10
- typeof styles === 'number' ||
11
- typeof styles === 'boolean' ||
12
- (Array.isArray(styles) && styles.length === 0) ||
13
- (Object.keys(styles).length === 0 && styles.constructor === Object)
14
- ) {
15
- return;
16
- }
17
-
18
- await waitForFrame();
19
-
20
- if (Array.isArray(styles)) {
21
- styles.forEach((style: { key: string; value: string }) => (el.style[style.key] = style.value));
22
- } else {
23
- Object.keys(styles).forEach((key) => (el.style[key] = styles[key]));
24
- }
25
- };
26
-
27
- export const get = async (el: HTMLElement): Promise<CSSStyleDeclaration> => {
28
- await waitForFrame();
29
-
30
- return getComputedStyle(el, null);
31
- };
@@ -1,274 +0,0 @@
1
- .ph.speccer.dissection
2
- font-family sans-serif
3
- height var(--ph-speccer-pin-size)
4
- width var(--ph-speccer-pin-size)
5
- display flex
6
- position absolute
7
- border-radius 100%
8
- background-color var(--ph-speccer-pin-color)
9
- color var(--ph-speccer-color-text-light)
10
- font-weight 400
11
- align-items center
12
- justify-content center
13
- line-height 150%
14
- font-size 16px
15
- z-index 100000
16
- box-sizing content-box
17
-
18
- .ph.speccer.dissection:after
19
- content ""
20
- position absolute
21
- height var(--ph-speccer-pin-space)
22
- top 100%
23
- width var(--ph-speccer-line-width)
24
- background-color var(--ph-speccer-pin-color)
25
- z-index 99999
26
-
27
-
28
- .ph.speccer.dissection.outline:after,
29
- .ph.speccer.dissection.outline.top:after
30
- height var(--ph-speccer-pin-space)
31
- width var(--ph-speccer-line-width)
32
- top 100%
33
- right 50%
34
-
35
- .ph.speccer.dissection.outline.left:after
36
- height var(--ph-speccer-line-width)
37
- width var(--ph-speccer-pin-space)
38
- top 50%
39
- left 100%
40
-
41
- .ph.speccer.dissection.outline.right:after
42
- height var(--ph-speccer-line-width)
43
- width var(--ph-speccer-pin-space)
44
- top 50%
45
- right 100%
46
-
47
- .ph.speccer.dissection.outline.bottom:after
48
- height var(--ph-speccer-pin-space)
49
- width var(--ph-speccer-line-width)
50
- top calc(-100% - (var(--ph-speccer-pin-space) / 2))
51
- right 50%
52
-
53
-
54
- .ph.speccer.dissection
55
- &:after
56
- content ""
57
- position absolute
58
- height var(--ph-speccer-pin-space)
59
- top 100%
60
- width var(--ph-speccer-line-width)
61
- background-color var(--ph-speccer-pin-color)
62
- z-index 99999
63
- &.outline
64
- &.left
65
- &:after
66
- height var(--ph-speccer-line-width)
67
- width var(--ph-speccer-pin-space)
68
- top 50%
69
- left 100%
70
- &.right
71
- &:after
72
- height var(--ph-speccer-line-width)
73
- width var(--ph-speccer-pin-space)
74
- top 50%
75
- right 100%
76
- &.enclose
77
- border-radius 0
78
- background-color transparent
79
- color var(--ph-speccer-measure-color)
80
- border var(--ph-speccer-line-width) solid var(--ph-speccer-pin-color)
81
- &.right
82
- &:after
83
- left calc(100% + calc(var(--ph-speccer-pin-space) + var(--ph-speccer-line-width)))
84
- right auto
85
- &:before
86
- left 100%
87
- right auto
88
- &.left
89
- &:after
90
- left calc(var(--ph-speccer-line-width-negative) - var(--ph-speccer-pin-size) - var(--ph-speccer-pin-space))
91
- right auto
92
- &:before
93
- right 100%
94
- left auto
95
- &.top
96
- &:after
97
- top calc(var(--ph-speccer-line-width-negative) - var(--ph-speccer-pin-size) - var(--ph-speccer-pin-space))
98
- bottom auto
99
- &:before
100
- bottom 100%
101
- top auto
102
- &.bottom
103
- &:after
104
- top calc(100% + calc(var(--ph-speccer-pin-space) + var(--ph-speccer-line-width)))
105
- bottom auto
106
- &:before
107
- top 100%
108
- bottom auto
109
- &.full
110
- border-radius 0
111
- background-color transparent
112
- color var(--ph-speccer-measure-color)
113
- border var(--ph-speccer-line-width) solid var(--ph-speccer-pin-color)
114
- &.right
115
- border-left none
116
- &:after
117
- left calc(8px + var(--ph-speccer-pin-space))
118
- &:before
119
- left 100%
120
- &.left
121
- border-right none
122
- &:after
123
- left calc(-8px - var(--ph-speccer-pin-space))
124
- &:before
125
- right 100%
126
- &.top
127
- border-bottom none
128
- &:after
129
- top calc(-8px - var(--ph-speccer-pin-space))
130
- &:before
131
- bottom 100%
132
- &.bottom
133
- border-top none
134
- &:after
135
- top calc(8px + var(--ph-speccer-pin-space))
136
- &:before
137
- top 100%
138
- &.bottom
139
- &:after
140
- height var(--ph-speccer-pin-space)
141
- width var(--ph-speccer-line-width)
142
- top calc(-100% - (var(--ph-speccer-pin-space) / 2))
143
- right 50%
144
-
145
-
146
- .ph.speccer.dissection.outline.top:after,
147
- .ph.speccer.dissection.outline:after
148
- height var(--ph-speccer-pin-space)
149
- width var(--ph-speccer-line-width)
150
- top 100%
151
- right 50%
152
-
153
- [data-anatomy-section]
154
- counter-reset type
155
-
156
- .ph.speccer.dissection.outline.full.right,
157
- .ph.speccer.dissection.outline.full.left
158
- width 8px
159
-
160
- .ph.speccer.dissection.outline.full.top,
161
- .ph.speccer.dissection.outline.full.bottom
162
- height 8px
163
-
164
- .ph.speccer.dissection.outline.full.right:after,
165
- .ph.speccer.dissection.outline.full.left:after,
166
- .ph.speccer.dissection.outline.full.top:after,
167
- .ph.speccer.dissection.outline.full.bottom:after
168
- content attr(data-dissection-counter)
169
- height var(--ph-speccer-pin-size)
170
- width var(--ph-speccer-pin-size)
171
- display flex
172
- position absolute
173
- border-radius 100%
174
- background-color var(--ph-speccer-pin-color)
175
- color var(--ph-speccer-color-text-light)
176
- align-items center
177
- justify-content center
178
- line-height 150%
179
- font-size 16px
180
- z-index 100000
181
-
182
- .ph.speccer.dissection.outline.full.right:after,
183
- .ph.speccer.dissection.outline.full.left:after
184
- top 50%
185
- transform translateY(-50%)
186
-
187
- .ph.speccer.dissection.outline.full.top:after,
188
- .ph.speccer.dissection.outline.full.bottom:after
189
- left 50%
190
- transform translateX(-50%)
191
-
192
- .ph.speccer.dissection.outline.full.right:before,
193
- .ph.speccer.dissection.outline.full.left:before,
194
- .ph.speccer.dissection.outline.full.top:before,
195
- .ph.speccer.dissection.outline.full.bottom:before
196
- content ""
197
- position absolute
198
- background-color var(--ph-speccer-pin-color)
199
- z-index 100000
200
- display block
201
-
202
- .ph.speccer.dissection.outline.full.right:before,
203
- .ph.speccer.dissection.outline.full.left:before
204
- top 50%
205
- transform translateY(-50%)
206
- height var(--ph-speccer-line-width)
207
- width calc(var(--ph-speccer-pin-space) + var(--ph-speccer-line-width))
208
-
209
- .ph.speccer.dissection.outline.full.top:before,
210
- .ph.speccer.dissection.outline.full.bottom:before
211
- left 50%
212
- transform translateX(-50%)
213
- width var(--ph-speccer-line-width)
214
- height calc(var(--ph-speccer-pin-space) + var(--ph-speccer-line-width))
215
-
216
- .ph.speccer.dissection.outline.enclose.right,
217
- .ph.speccer.dissection.outline.enclose.left
218
- width 8px
219
-
220
- .ph.speccer.dissection.outline.enclose.top,
221
- .ph.speccer.dissection.outline.enclose.bottom
222
- height 8px
223
-
224
- .ph.speccer.dissection.outline.enclose.right:after,
225
- .ph.speccer.dissection.outline.enclose.left:after,
226
- .ph.speccer.dissection.outline.enclose.top:after,
227
- .ph.speccer.dissection.outline.enclose.bottom:after
228
- content attr(data-dissection-counter)
229
- height var(--ph-speccer-pin-size)
230
- width var(--ph-speccer-pin-size)
231
- display flex
232
- position absolute
233
- border-radius 100%
234
- background-color var(--ph-speccer-pin-color)
235
- color var(--ph-speccer-color-text-light)
236
- align-items center
237
- justify-content center
238
- line-height 150%
239
- font-size 16px
240
- z-index 100000
241
-
242
- .ph.speccer.dissection.outline.enclose.right:after,
243
- .ph.speccer.dissection.outline.enclose.left:after
244
- top 50%
245
- transform translateY(-50%)
246
-
247
- .ph.speccer.dissection.outline.enclose.top:after,
248
- .ph.speccer.dissection.outline.enclose.bottom:after
249
- left 50%
250
- transform translateX(-50%)
251
-
252
- .ph.speccer.dissection.outline.enclose.right:before,
253
- .ph.speccer.dissection.outline.enclose.left:before,
254
- .ph.speccer.dissection.outline.enclose.top:before,
255
- .ph.speccer.dissection.outline.enclose.bottom:before
256
- content ""
257
- position absolute
258
- background-color var(--ph-speccer-pin-color)
259
- z-index 100000
260
- display block
261
-
262
- .ph.speccer.dissection.outline.enclose.right:before,
263
- .ph.speccer.dissection.outline.enclose.left:before
264
- top 50%
265
- transform translateY(-50%)
266
- height var(--ph-speccer-line-width)
267
- width calc(var(--ph-speccer-pin-space) + var(--ph-speccer-line-width))
268
-
269
- .ph.speccer.dissection.outline.enclose.top:before,
270
- .ph.speccer.dissection.outline.enclose.bottom:before
271
- left 50%
272
- transform translateX(-50%)
273
- width var(--ph-speccer-line-width)
274
- height calc(var(--ph-speccer-pin-space) + var(--ph-speccer-line-width))
@@ -1,72 +0,0 @@
1
- $ph-speccer-color-padding = rgba(219, 111, 255, 0.4);
2
- $ph-speccer-color-padding-hover = rgb(219, 111, 255);
3
- $ph-speccer-color-margin = rgba(255, 247, 111, 0.4);
4
- $ph-speccer-color-margin-hover = rgb(255, 247, 111);
5
- $ph-speccer-color-text-light = rgb(255, 255, 255);
6
- $ph-speccer-color-text-dark = rgb(51,51,51);
7
- $ph-speccer-color-contrast = rgb(255, 58, 168);
8
- $ph-speccer-spacing-color = $ph-speccer-color-contrast;
9
- $ph-speccer-measure-color = rgb(255,0,0);
10
- $ph-speccer-pin-color = $ph-speccer-color-contrast;
11
- $ph-speccer-typography-background-color = rgb(255, 255,255);
12
- $ph-speccer-typography-color-property = rgb(63, 133, 242);
13
- $ph-speccer-typography-color-text = rgb(87, 87, 91);
14
- $ph-speccer-typography-color-value = $ph-speccer-color-contrast;
15
- $ph-speccer-depth-opacity-400 = 0.4;
16
- $ph-speccer-font-family = "Menlo for Powerline", "Menlo Regular for Powerline", "DejaVu Sans Mono", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
17
- $ph-speccer-font-size = 12px;
18
- $ph-speccer-line-height = 12px;
19
- $ph-speccer-pin-size = 24px
20
- $ph-speccer-pin-space = 48px
21
- $ph-speccer-line-width = 1px
22
- $ph-speccer-line-width-negative = -1px
23
- $ph-speccer-measure-size = 8px
24
-
25
-
26
- .ph.speccer
27
- --ph-speccer-color-padding: $ph-speccer-color-padding;
28
- --ph-speccer-color-padding-hover: $ph-speccer-color-padding-hover;
29
- --ph-speccer-color-margin: $ph-speccer-color-margin;
30
- --ph-speccer-color-margin-hover: $ph-speccer-color-margin-hover;
31
- --ph-speccer-color-text-light: $ph-speccer-color-text-light;
32
- --ph-speccer-color-text-dark: $ph-speccer-color-text-dark;
33
- --ph-speccer-color-contrast: $ph-speccer-color-contrast;
34
- --ph-speccer-spacing-color: var(--ph-speccer-color-contrast);
35
- --ph-speccer-measure-color: $ph-speccer-measure-color;
36
- --ph-speccer-pin-color: var(--ph-speccer-color-contrast);
37
- --ph-speccer-typography-background-color: $ph-speccer-typography-background-color;
38
- --ph-speccer-typography-color-property: $ph-speccer-typography-color-property;
39
- --ph-speccer-typography-color-text: $ph-speccer-typography-color-text;
40
- --ph-speccer-typography-color-value: var(--ph-speccer-color-contrast);
41
- --ph-speccer-depth-opacity-400: $ph-speccer-depth-opacity-400;
42
- --ph-speccer-font-family: $ph-speccer-font-family;
43
- --ph-speccer-font-size: $ph-speccer-font-size;
44
- --ph-speccer-line-height: $ph-speccer-line-height;
45
- --ph-speccer-pin-size: $ph-speccer-pin-size;
46
- --ph-speccer-pin-space: $ph-speccer-pin-space;
47
- --ph-speccer-line-width: $ph-speccer-line-width;
48
- --ph-speccer-line-width-negative: $ph-speccer-line-width-negative;
49
- --ph-speccer-measure-size: $ph-speccer-measure-size;
50
-
51
- body.ph
52
- margin 12px
53
- padding 12px
54
- box-sizing border-box
55
-
56
- .ph.speccer,
57
- .ph.speccer::after,
58
- .ph.speccer::before
59
- font-family var(--ph-speccer-font-family) !important
60
- justify-content center
61
- align-items center
62
- z-index 99999
63
- position absolute
64
- pointer-events none
65
- user-select none
66
- display flex
67
- font-size 12px
68
- box-sizing border-box
69
- line-height 12px
70
-
71
- @require './anatomy.styl'
72
- @require './spacing.styl'