@phun-ky/speccer 6.0.0 → 6.0.3
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/README.md +4 -4
- package/package.json +7 -1
- package/speccer.css +0 -5
- package/speccer.js +1 -1
- package/speccer.js.map +1 -1
- package/speccer.min.css +1 -1
- package/CHANGELOG.md +0 -78
- package/dts/browser.d.ts +0 -4
- package/dts/enums/area.d.ts +0 -16
- package/dts/helpers/dissect/index.d.ts +0 -1
- package/dts/helpers/dissect/styles.d.ts +0 -1
- package/dts/helpers/typography/index.d.ts +0 -2
- package/dts/helpers/typography/position.d.ts +0 -4
- package/dts/helpers/typography/template.d.ts +0 -1
- package/dts/index.d.ts +0 -53
- package/dts/interfaces/global.d.ts +0 -6
- package/dts/lib/attributes.d.ts +0 -2
- package/dts/lib/classnames.d.ts +0 -4
- package/dts/lib/constants.d.ts +0 -3
- package/dts/lib/css.d.ts +0 -6
- package/dts/lib/debounce.d.ts +0 -3
- package/dts/lib/node.d.ts +0 -2
- package/dts/lib/number.d.ts +0 -1
- package/dts/lib/position.d.ts +0 -6
- package/dts/lib/resize.d.ts +0 -1
- package/dts/lib/styles.d.ts +0 -2
- package/dts/tasks/dissect.d.ts +0 -2
- package/dts/tasks/index.d.ts +0 -4
- package/dts/tasks/measure.d.ts +0 -1
- package/dts/tasks/spec.d.ts +0 -2
- package/dts/tasks/typography.d.ts +0 -2
- package/dts/types/css.d.ts +0 -19
- package/dts/types/speccer.d.ts +0 -5
- package/src/browser.ts +0 -96
- package/src/enums/area.ts +0 -17
- package/src/helpers/dissect/index.ts +0 -1
- package/src/helpers/dissect/styles.ts +0 -154
- package/src/helpers/typography/index.ts +0 -3
- package/src/helpers/typography/position.ts +0 -54
- package/src/helpers/typography/template.ts +0 -27
- package/src/index.ts +0 -36
- package/src/interfaces/global.ts +0 -7
- package/src/lib/attributes.ts +0 -18
- package/src/lib/classnames.ts +0 -43
- package/src/lib/constants.ts +0 -8
- package/src/lib/css.ts +0 -45
- package/src/lib/debounce.ts +0 -29
- package/src/lib/node.ts +0 -8
- package/src/lib/number.ts +0 -4
- package/src/lib/position.ts +0 -16
- package/src/lib/resize.ts +0 -14
- package/src/lib/styles.ts +0 -31
- package/src/styles/anatomy.styl +0 -274
- package/src/styles/index.styl +0 -72
- package/src/styles/measure.styl +0 -88
- package/src/styles/spacing.styl +0 -142
- package/src/styles/typography.styl +0 -85
- package/src/tasks/dissect.ts +0 -46
- package/src/tasks/index.ts +0 -7
- package/src/tasks/measure.ts +0 -82
- package/src/tasks/spec.ts +0 -170
- package/src/tasks/typography.ts +0 -45
- package/src/types/css.ts +0 -20
- package/src/types/speccer.ts +0 -6
- package/tsconfig.json +0 -21
- package/tslint.json +0 -23
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;
|
package/src/lib/debounce.ts
DELETED
|
@@ -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
package/src/lib/position.ts
DELETED
|
@@ -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
|
-
};
|
package/src/styles/anatomy.styl
DELETED
|
@@ -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))
|
package/src/styles/index.styl
DELETED
|
@@ -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'
|
package/src/styles/measure.styl
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
.ph.speccer.measure
|
|
2
|
-
&.width
|
|
3
|
-
color var(--ph-speccer-measure-color)
|
|
4
|
-
border var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color)
|
|
5
|
-
border-bottom none
|
|
6
|
-
height var(--ph-speccer-measure-size)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.ph.speccer.measure
|
|
10
|
-
&.width
|
|
11
|
-
&::after
|
|
12
|
-
content attr(data-measure)
|
|
13
|
-
position absolute
|
|
14
|
-
top calc(-100% - 10px)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.ph.speccer.measure
|
|
18
|
-
&.width
|
|
19
|
-
&.bottom
|
|
20
|
-
color var(--ph-speccer-measure-color)
|
|
21
|
-
border var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color)
|
|
22
|
-
border-top none
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.ph.speccer.measure
|
|
26
|
-
&.width
|
|
27
|
-
&.bottom
|
|
28
|
-
&::after
|
|
29
|
-
content attr(data-measure)
|
|
30
|
-
position absolute
|
|
31
|
-
top calc(100% + 5px)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.ph.speccer.measure
|
|
35
|
-
&.width
|
|
36
|
-
&.top
|
|
37
|
-
color var(--ph-speccer-measure-color)
|
|
38
|
-
border var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color)
|
|
39
|
-
border-bottom none
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.ph.speccer.measure
|
|
43
|
-
&.width
|
|
44
|
-
&.top
|
|
45
|
-
&::after
|
|
46
|
-
content attr(data-measure)
|
|
47
|
-
position absolute
|
|
48
|
-
bottom calc(100% + 5px)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.ph.speccer.measure
|
|
52
|
-
&.height
|
|
53
|
-
&.left
|
|
54
|
-
color var(--ph-speccer-measure-color)
|
|
55
|
-
border var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color)
|
|
56
|
-
border-right none
|
|
57
|
-
width var(--ph-speccer-measure-size)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.ph.speccer.measure
|
|
61
|
-
&.height
|
|
62
|
-
&.left
|
|
63
|
-
&::after
|
|
64
|
-
content attr(data-measure)
|
|
65
|
-
position absolute
|
|
66
|
-
top 50%
|
|
67
|
-
left calc(-100% - 20px - var(--ph-speccer-line-width))
|
|
68
|
-
transform translateY(-50%) rotate(-90deg)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.ph.speccer.measure
|
|
72
|
-
&.height
|
|
73
|
-
&.right
|
|
74
|
-
color var(--ph-speccer-measure-color)
|
|
75
|
-
border var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color)
|
|
76
|
-
border-left none
|
|
77
|
-
width var(--ph-speccer-measure-size)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.ph.speccer.measure
|
|
81
|
-
&.height
|
|
82
|
-
&.right
|
|
83
|
-
&::after
|
|
84
|
-
content attr(data-measure)
|
|
85
|
-
position absolute
|
|
86
|
-
top 50%
|
|
87
|
-
left calc(100% - var(--ph-speccer-measure-size))
|
|
88
|
-
transform translateY(-50%) rotate(90deg)
|