@phun-ky/speccer 10.1.0 → 11.1.0
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 +143 -41
- package/dist/speccer.css +325 -122
- package/dist/speccer.d.ts +67 -12
- package/dist/speccer.esm.js +2 -2
- package/dist/speccer.esm.js.map +1 -1
- package/dist/speccer.js +2 -2
- package/dist/speccer.js.map +1 -1
- package/dist/speccer.min.css +1 -1
- package/package.json +1 -1
package/dist/speccer.css
CHANGED
|
@@ -13,19 +13,22 @@
|
|
|
13
13
|
.ph-speccer.speccer{
|
|
14
14
|
--ph-speccer-base-color: var(--ph-speccer-color-artificialStrawberry);
|
|
15
15
|
--ph-speccer-spacing-color: var(--ph-speccer-base-color);
|
|
16
|
-
--ph-speccer-spacing-color
|
|
17
|
-
--ph-speccer-spacing-color-
|
|
18
|
-
--ph-speccer-spacing-color
|
|
19
|
-
--ph-speccer-spacing-color-
|
|
16
|
+
--ph-speccer-spacing-padding-color: var(--ph-speccer-color-carbon);
|
|
17
|
+
--ph-speccer-spacing-padding-color-background: rgb(from var(--ph-speccer-color-venusSlipperOrchid) r g b / var(--ph-speccer-opacity-40));
|
|
18
|
+
--ph-speccer-spacing-margin-color: var(--ph-speccer-color-red);
|
|
19
|
+
--ph-speccer-spacing-margin-color-background: rgb(from var(--ph-speccer-color-superBanana) r g b / var(--ph-speccer-opacity-40));
|
|
20
|
+
--ph-speccer-spacing-line-width: var(--ph-speccer-line-width);
|
|
20
21
|
--ph-speccer-typography-background-color: var(--ph-speccer-color-white);
|
|
21
22
|
--ph-speccer-typography-color-property: var(--ph-speccer-color-niuZaiSeDenim);
|
|
22
23
|
--ph-speccer-typography-color-text: var(--ph-speccer-base-color);
|
|
23
24
|
--ph-speccer-typography-color-value: var(--ph-speccer-base-color);
|
|
24
25
|
--ph-speccer-mark-background-color: rgb(from var(--ph-speccer-base-color) r g b / var(--ph-speccer-opacity-20));
|
|
25
26
|
--ph-speccer-mark-border-color: var(--ph-speccer-base-color);
|
|
26
|
-
--ph-speccer-mark-border-width:
|
|
27
|
+
--ph-speccer-mark-border-width: 1.5px;
|
|
27
28
|
--ph-speccer-mark-border-style: solid;
|
|
28
29
|
--ph-speccer-measure-color: var(--ph-speccer-color-red);
|
|
30
|
+
--ph-speccer-measure-line-width: 1.5px;
|
|
31
|
+
--ph-speccer-measure-border-style: dotted;
|
|
29
32
|
--ph-speccer-measure-size: 8px;
|
|
30
33
|
--ph-speccer-a11y-color-background: var(--ph-speccer-color-beautifulBlue);
|
|
31
34
|
--ph-speccer-a11y-landmark-color-background: var(--ph-speccer-color-fuchsiaBlue);
|
|
@@ -35,8 +38,8 @@
|
|
|
35
38
|
--ph-speccer-pin-size: 24px;
|
|
36
39
|
--ph-speccer-pin-space: 48px;
|
|
37
40
|
--ph-speccer-line-height: 12px;
|
|
38
|
-
--ph-speccer-line-width:
|
|
39
|
-
--ph-speccer-line-width-negative: -
|
|
41
|
+
--ph-speccer-line-width: 1.5px;
|
|
42
|
+
--ph-speccer-line-width-negative: -1.5px;
|
|
40
43
|
--ph-speccer-opacity-20: 0.2;
|
|
41
44
|
--ph-speccer-opacity-40: 0.4;
|
|
42
45
|
--ph-speccer-font-family: "Menlo for Powerline", "Menlo Regular for Powerline", "DejaVu Sans Mono", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
|
@@ -88,7 +91,7 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
88
91
|
counter-reset: type;
|
|
89
92
|
}
|
|
90
93
|
.ph-speccer.speccer.pin {
|
|
91
|
-
font-family:
|
|
94
|
+
font-family: var(--ph-speccer-font-family);
|
|
92
95
|
height: var(--ph-speccer-pin-size);
|
|
93
96
|
width: var(--ph-speccer-pin-size);
|
|
94
97
|
display: flex;
|
|
@@ -113,6 +116,7 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
113
116
|
z-index: 99999;
|
|
114
117
|
}
|
|
115
118
|
.ph-speccer.speccer.pin.svg::after,
|
|
119
|
+
.ph-speccer.speccer.pin.text::after,
|
|
116
120
|
.ph-speccer.speccer.pin.curly::after {
|
|
117
121
|
content: none !important;
|
|
118
122
|
}
|
|
@@ -155,6 +159,59 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
155
159
|
top: 50%;
|
|
156
160
|
right: 100%;
|
|
157
161
|
}
|
|
162
|
+
.ph-speccer.path.speccer.text {
|
|
163
|
+
color: var(--ph-speccer-color-text-dark);
|
|
164
|
+
}
|
|
165
|
+
.ph-speccer.speccer.pin.text {
|
|
166
|
+
font-family: var(--ph-speccer-font-family);
|
|
167
|
+
height: auto;
|
|
168
|
+
min-height: var(--ph-speccer-pin-size);
|
|
169
|
+
display: flex;
|
|
170
|
+
position: absolute;
|
|
171
|
+
border-radius: 0;
|
|
172
|
+
background-color: transparent;
|
|
173
|
+
color: var(--ph-speccer-color-text-dark);
|
|
174
|
+
font-weight: 400;
|
|
175
|
+
align-items: flex-start;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
line-height: 130%;
|
|
178
|
+
z-index: 100000;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
width: 250px;
|
|
181
|
+
grid-gap: 2px;
|
|
182
|
+
}
|
|
183
|
+
.ph-speccer.speccer.pin.text.right {
|
|
184
|
+
padding-left: 1rem;
|
|
185
|
+
}
|
|
186
|
+
.ph-speccer.speccer.pin.text.left {
|
|
187
|
+
padding-right: 1rem;
|
|
188
|
+
width: 170px;
|
|
189
|
+
}
|
|
190
|
+
.ph-speccer.speccer.pin.text.top {
|
|
191
|
+
padding-bottom: 1rem;
|
|
192
|
+
}
|
|
193
|
+
.ph-speccer.speccer.pin.text.bottom {
|
|
194
|
+
padding-top: 1rem;
|
|
195
|
+
}
|
|
196
|
+
.ph-speccer.speccer.pin.text .ph-speccer.title {
|
|
197
|
+
text-transform: uppercase;
|
|
198
|
+
font-weight: 500;
|
|
199
|
+
font-size: 11px;
|
|
200
|
+
}
|
|
201
|
+
.ph-speccer.speccer.pin.text .ph-speccer.description {
|
|
202
|
+
line-height: 130%;
|
|
203
|
+
position: relative;
|
|
204
|
+
font-weight: 600;
|
|
205
|
+
font-size: 0.875rem;
|
|
206
|
+
}
|
|
207
|
+
.ph-speccer.speccer.pin.text .ph-speccer.heading {
|
|
208
|
+
line-height: 130%;
|
|
209
|
+
position: relative;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
font-size: 0.875rem;
|
|
212
|
+
text-transform: uppercase;
|
|
213
|
+
color: var(--ph-speccer-base-color);
|
|
214
|
+
}
|
|
158
215
|
.ph-speccer.speccer.pin.enclose {
|
|
159
216
|
border-radius: 0;
|
|
160
217
|
background-color: transparent;
|
|
@@ -668,6 +725,13 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
668
725
|
}
|
|
669
726
|
.ph-speccer.speccer.typography.syntax > pre {
|
|
670
727
|
margin: 0;
|
|
728
|
+
padding: 0;
|
|
729
|
+
font-size: 12px;
|
|
730
|
+
line-height: 1.5;
|
|
731
|
+
font-family: var(--ph-speccer-font-family);
|
|
732
|
+
color: var(--ph-speccer-color-text-light);
|
|
733
|
+
background: transparent;
|
|
734
|
+
border-radius: 0;
|
|
671
735
|
}
|
|
672
736
|
.ph-speccer.speccer.typography.syntax {
|
|
673
737
|
--ph-speccer-color-code-color-1: #737373;
|
|
@@ -808,7 +872,7 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
808
872
|
left: -32px;
|
|
809
873
|
top: 100%;
|
|
810
874
|
width: 32px;
|
|
811
|
-
height: calc(var(--ph-speccer-grid-gap) + 2px);
|
|
875
|
+
height: calc(var(--ph-speccer-grid-row-gap) + 2px);
|
|
812
876
|
border-top-left-radius: 50%;
|
|
813
877
|
border-bottom-left-radius: 50%;
|
|
814
878
|
}
|
|
@@ -846,7 +910,7 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
846
910
|
left: -32px;
|
|
847
911
|
top: 100%;
|
|
848
912
|
width: 32px;
|
|
849
|
-
height: calc(var(--ph-speccer-grid-gap) + 2px);
|
|
913
|
+
height: calc(var(--ph-speccer-grid-row-gap) + 2px);
|
|
850
914
|
border-top-left-radius: 50%;
|
|
851
915
|
border-bottom-left-radius: 50%;
|
|
852
916
|
}
|
|
@@ -883,185 +947,324 @@ svg.ph-speccer .ph-speccer.circle {
|
|
|
883
947
|
bottom: calc((var(--ph-speccer-grid-row-gap) + 2px) / 2 * -1);
|
|
884
948
|
}
|
|
885
949
|
.ph-speccer.speccer.spacing {
|
|
886
|
-
pointer-events:
|
|
950
|
+
pointer-events: none;
|
|
887
951
|
transition: none;
|
|
888
|
-
|
|
889
|
-
}
|
|
890
|
-
.ph-speccer.speccer.spacing:hover {
|
|
891
|
-
border: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
892
|
-
}
|
|
893
|
-
.ph-speccer.speccer.spacing.margin {
|
|
894
|
-
background-color: var(--ph-speccer-spacing-color-margin);
|
|
895
|
-
color: var(--ph-speccer-color-text-dark);
|
|
952
|
+
white-space: nowrap;
|
|
896
953
|
}
|
|
897
954
|
.ph-speccer.speccer.spacing.padding {
|
|
898
|
-
background-color: var(--ph-speccer-spacing-color-
|
|
899
|
-
color: var(--ph-speccer-spacing-color);
|
|
900
|
-
}
|
|
901
|
-
.ph-speccer.speccer.spacing.margin.bottom::after,
|
|
902
|
-
.ph-speccer.speccer.spacing.margin.top::after {
|
|
903
|
-
transition: none;
|
|
904
|
-
content: "";
|
|
905
|
-
position: absolute;
|
|
906
|
-
height: 100%;
|
|
907
|
-
border-top: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
908
|
-
border-bottom: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
909
|
-
width: 9px;
|
|
910
|
-
left: 40%;
|
|
911
|
-
}
|
|
912
|
-
.ph-speccer.speccer.spacing.margin.bottom::before,
|
|
913
|
-
.ph-speccer.speccer.spacing.margin.top::before {
|
|
914
|
-
transition: none;
|
|
915
|
-
content: "";
|
|
916
|
-
position: absolute;
|
|
917
|
-
height: 100%;
|
|
918
|
-
border-left: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
919
|
-
margin-left: 4px;
|
|
920
|
-
width: 0;
|
|
921
|
-
left: 40%;
|
|
955
|
+
background-color: var(--ph-speccer-spacing-padding-color-background);
|
|
956
|
+
color: var(--ph-speccer-spacing-padding-color);
|
|
922
957
|
}
|
|
923
|
-
.ph-speccer.speccer.spacing.
|
|
924
|
-
.ph-speccer.speccer.spacing.
|
|
958
|
+
.ph-speccer.speccer.spacing.padding::after,
|
|
959
|
+
.ph-speccer.speccer.spacing.padding::before {
|
|
925
960
|
transition: none;
|
|
926
961
|
content: "";
|
|
927
962
|
position: absolute;
|
|
928
|
-
height: 9px;
|
|
929
|
-
border-right: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
930
|
-
border-left: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
931
|
-
width: 100%;
|
|
932
|
-
top: 10%;
|
|
933
963
|
}
|
|
934
|
-
.ph-speccer.speccer.spacing.
|
|
935
|
-
.ph-speccer.speccer.spacing.
|
|
936
|
-
|
|
937
|
-
content:
|
|
938
|
-
|
|
939
|
-
height: 0;
|
|
940
|
-
border-top: var(--ph-speccer-line-width) solid var(--ph-speccer-color-text-dark);
|
|
941
|
-
margin-top: 4px;
|
|
942
|
-
width: 100%;
|
|
943
|
-
top: 10%;
|
|
964
|
+
.ph-speccer.speccer.spacing.padding.bottom,
|
|
965
|
+
.ph-speccer.speccer.spacing.padding.top {
|
|
966
|
+
display: flex;
|
|
967
|
+
justify-content: flex-start;
|
|
968
|
+
padding-left: 4px;
|
|
944
969
|
}
|
|
945
970
|
.ph-speccer.speccer.spacing.padding.bottom::after,
|
|
946
971
|
.ph-speccer.speccer.spacing.padding.top::after {
|
|
947
|
-
|
|
948
|
-
content: "";
|
|
949
|
-
position: absolute;
|
|
972
|
+
left: calc(6ch - 5px);
|
|
950
973
|
height: 100%;
|
|
951
|
-
|
|
952
|
-
border-
|
|
953
|
-
|
|
954
|
-
left: 40%;
|
|
974
|
+
width: 10px;
|
|
975
|
+
border-top: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-padding-color);
|
|
976
|
+
border-bottom: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-padding-color);
|
|
955
977
|
}
|
|
956
978
|
.ph-speccer.speccer.spacing.padding.bottom::before,
|
|
957
979
|
.ph-speccer.speccer.spacing.padding.top::before {
|
|
958
|
-
|
|
959
|
-
content: "";
|
|
960
|
-
position: absolute;
|
|
980
|
+
left: 6ch;
|
|
961
981
|
height: 100%;
|
|
962
|
-
border-left: var(--ph-speccer-line-width) solid var(--ph-speccer-spacing-color);
|
|
963
|
-
margin-left: 4px;
|
|
982
|
+
border-left: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-padding-color);
|
|
964
983
|
width: 0;
|
|
965
|
-
|
|
984
|
+
}
|
|
985
|
+
.ph-speccer.speccer.spacing.padding.left,
|
|
986
|
+
.ph-speccer.speccer.spacing.padding.right {
|
|
987
|
+
display: flex;
|
|
988
|
+
justify-content: flex-end;
|
|
989
|
+
flex-direction: column;
|
|
990
|
+
padding-bottom: 4px;
|
|
966
991
|
}
|
|
967
992
|
.ph-speccer.speccer.spacing.padding.left::after,
|
|
968
993
|
.ph-speccer.speccer.spacing.padding.right::after {
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
position: absolute;
|
|
972
|
-
height: 9px;
|
|
973
|
-
border-right: var(--ph-speccer-line-width) solid var(--ph-speccer-spacing-color);
|
|
974
|
-
border-left: var(--ph-speccer-line-width) solid var(--ph-speccer-spacing-color);
|
|
994
|
+
top: calc(100% - 24px - 10px);
|
|
995
|
+
height: 10px;
|
|
975
996
|
width: 100%;
|
|
976
|
-
|
|
997
|
+
border-right: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-padding-color);
|
|
998
|
+
border-left: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-padding-color);
|
|
977
999
|
}
|
|
978
1000
|
.ph-speccer.speccer.spacing.padding.left::before,
|
|
979
1001
|
.ph-speccer.speccer.spacing.padding.right::before {
|
|
1002
|
+
top: calc(100% - 24px - 5px);
|
|
1003
|
+
height: 0;
|
|
1004
|
+
border-top: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-padding-color);
|
|
1005
|
+
width: 100%;
|
|
1006
|
+
}
|
|
1007
|
+
.ph-speccer.speccer.spacing.margin {
|
|
1008
|
+
background-color: var(--ph-speccer-spacing-margin-color-background);
|
|
1009
|
+
color: var(--ph-speccer-spacing-margin-color);
|
|
1010
|
+
}
|
|
1011
|
+
.ph-speccer.speccer.spacing.margin.bottom,
|
|
1012
|
+
.ph-speccer.speccer.spacing.margin.top {
|
|
1013
|
+
display: flex;
|
|
1014
|
+
justify-content: flex-start;
|
|
1015
|
+
padding-left: 4px;
|
|
1016
|
+
}
|
|
1017
|
+
.ph-speccer.speccer.spacing.margin.right,
|
|
1018
|
+
.ph-speccer.speccer.spacing.margin.left {
|
|
1019
|
+
display: flex;
|
|
1020
|
+
justify-content: flex-end;
|
|
1021
|
+
flex-direction: column;
|
|
1022
|
+
padding-bottom: 4px;
|
|
1023
|
+
}
|
|
1024
|
+
.ph-speccer.speccer.spacing.margin::after,
|
|
1025
|
+
.ph-speccer.speccer.spacing.margin::before {
|
|
980
1026
|
transition: none;
|
|
981
1027
|
content: "";
|
|
982
1028
|
position: absolute;
|
|
1029
|
+
}
|
|
1030
|
+
.ph-speccer.speccer.spacing.margin.bottom::after,
|
|
1031
|
+
.ph-speccer.speccer.spacing.margin.top::after {
|
|
1032
|
+
left: calc(6ch - 5px);
|
|
1033
|
+
height: 100%;
|
|
1034
|
+
width: 10px;
|
|
1035
|
+
border-top: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-margin-color);
|
|
1036
|
+
border-bottom: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-margin-color);
|
|
1037
|
+
}
|
|
1038
|
+
.ph-speccer.speccer.spacing.margin.bottom::before,
|
|
1039
|
+
.ph-speccer.speccer.spacing.margin.top::before {
|
|
1040
|
+
left: 6ch;
|
|
1041
|
+
height: 100%;
|
|
1042
|
+
border-left: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-margin-color);
|
|
1043
|
+
width: 0;
|
|
1044
|
+
}
|
|
1045
|
+
.ph-speccer.speccer.spacing.margin.left::after,
|
|
1046
|
+
.ph-speccer.speccer.spacing.margin.right::after {
|
|
1047
|
+
height: 10px;
|
|
1048
|
+
border-right: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-margin-color);
|
|
1049
|
+
border-left: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-margin-color);
|
|
1050
|
+
width: 100%;
|
|
1051
|
+
top: calc(100% - 24px - 10px);
|
|
1052
|
+
}
|
|
1053
|
+
.ph-speccer.speccer.spacing.margin.left::before,
|
|
1054
|
+
.ph-speccer.speccer.spacing.margin.right::before {
|
|
983
1055
|
height: 0;
|
|
984
|
-
border-top: var(--ph-speccer-line-width) solid var(--ph-speccer-spacing-color);
|
|
985
|
-
margin-top: 4px;
|
|
1056
|
+
border-top: var(--ph-speccer-spacing-line-width) solid var(--ph-speccer-spacing-margin-color);
|
|
986
1057
|
width: 100%;
|
|
987
|
-
top:
|
|
1058
|
+
top: calc(100% - 24px - 5px);
|
|
1059
|
+
}
|
|
1060
|
+
.ph-speccer.speccer.spacing.bound.padding.bottom,
|
|
1061
|
+
.ph-speccer.speccer.spacing.bound.margin.bottom,
|
|
1062
|
+
.ph-speccer.speccer.spacing.bound.padding.top,
|
|
1063
|
+
.ph-speccer.speccer.spacing.bound.margin.top,
|
|
1064
|
+
.ph-speccer.speccer.spacing.bound.padding.right,
|
|
1065
|
+
.ph-speccer.speccer.spacing.bound.margin.right,
|
|
1066
|
+
.ph-speccer.speccer.spacing.bound.padding.left,
|
|
1067
|
+
.ph-speccer.speccer.spacing.bound.margin.left {
|
|
1068
|
+
justify-content: center;
|
|
1069
|
+
align-items: center;
|
|
1070
|
+
padding: 0;
|
|
988
1071
|
}
|
|
989
1072
|
.ph-speccer.speccer.measure {
|
|
990
1073
|
display: flex;
|
|
991
1074
|
}
|
|
992
|
-
.ph-speccer.speccer.measure.
|
|
1075
|
+
.ph-speccer.speccer.measure.height {
|
|
993
1076
|
color: var(--ph-speccer-measure-color);
|
|
994
|
-
border: var(--ph-speccer-line-width)
|
|
995
|
-
border-bottom:
|
|
996
|
-
height: var(--ph-speccer-measure-size);
|
|
1077
|
+
border-top: var(--ph-speccer-measure-line-width) var(--ph-speccer-measure-border-style);
|
|
1078
|
+
border-bottom: var(--ph-speccer-measure-line-width) var(--ph-speccer-measure-border-style);
|
|
997
1079
|
}
|
|
998
|
-
.ph-speccer.speccer.measure.
|
|
999
|
-
content:
|
|
1080
|
+
.ph-speccer.speccer.measure.height.left::before {
|
|
1081
|
+
content: '';
|
|
1082
|
+
display: block;
|
|
1083
|
+
height: calc(100% + var(--ph-speccer-measure-line-width));
|
|
1084
|
+
background: transparent;
|
|
1000
1085
|
position: absolute;
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
border: var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color);
|
|
1006
|
-
border-top: none;
|
|
1086
|
+
left: calc(64px - 5px);
|
|
1087
|
+
width: 10px;
|
|
1088
|
+
border-top: var(--ph-speccer-measure-line-width) solid;
|
|
1089
|
+
border-bottom: var(--ph-speccer-measure-line-width) solid;
|
|
1007
1090
|
}
|
|
1008
|
-
.ph-speccer.speccer.measure.
|
|
1091
|
+
.ph-speccer.speccer.measure.height.left::after {
|
|
1092
|
+
position: static;
|
|
1009
1093
|
content: attr(data-measure);
|
|
1094
|
+
display: flex;
|
|
1095
|
+
width: 64px;
|
|
1096
|
+
height: 100%;
|
|
1097
|
+
line-height: 100%;
|
|
1098
|
+
margin-right: auto;
|
|
1099
|
+
border-right: var(--ph-speccer-measure-line-width) solid;
|
|
1100
|
+
justify-content: flex-end;
|
|
1101
|
+
padding-right: 8px;
|
|
1102
|
+
}
|
|
1103
|
+
.ph-speccer.speccer.measure.height.right::before {
|
|
1104
|
+
content: '';
|
|
1105
|
+
display: block;
|
|
1106
|
+
height: calc(100% + var(--ph-speccer-measure-line-width));
|
|
1107
|
+
background: transparent;
|
|
1010
1108
|
position: absolute;
|
|
1011
|
-
|
|
1109
|
+
left: calc(100% - 64px - 5px);
|
|
1110
|
+
width: 10px;
|
|
1111
|
+
border-top: var(--ph-speccer-measure-line-width) solid;
|
|
1112
|
+
border-bottom: var(--ph-speccer-measure-line-width) solid;
|
|
1113
|
+
}
|
|
1114
|
+
.ph-speccer.speccer.measure.height.right::after {
|
|
1115
|
+
position: static;
|
|
1116
|
+
content: attr(data-measure);
|
|
1117
|
+
display: flex;
|
|
1118
|
+
width: 64px;
|
|
1119
|
+
height: 100%;
|
|
1120
|
+
line-height: 100%;
|
|
1121
|
+
margin-left: auto;
|
|
1122
|
+
border-left: var(--ph-speccer-measure-line-width) solid;
|
|
1123
|
+
justify-content: flex-start;
|
|
1124
|
+
padding-left: 8px;
|
|
1012
1125
|
}
|
|
1013
|
-
.ph-speccer.speccer.measure.width
|
|
1126
|
+
.ph-speccer.speccer.measure.width {
|
|
1127
|
+
flex-direction: column;
|
|
1128
|
+
align-items: center;
|
|
1129
|
+
justify-content: flex-start;
|
|
1014
1130
|
color: var(--ph-speccer-measure-color);
|
|
1015
|
-
border: var(--ph-speccer-line-width)
|
|
1016
|
-
border-
|
|
1131
|
+
border-left: var(--ph-speccer-measure-line-width) var(--ph-speccer-measure-border-style);
|
|
1132
|
+
border-right: var(--ph-speccer-measure-line-width) var(--ph-speccer-measure-border-style);
|
|
1133
|
+
}
|
|
1134
|
+
.ph-speccer.speccer.measure.width.top::before {
|
|
1135
|
+
content: '';
|
|
1136
|
+
display: block;
|
|
1137
|
+
width: calc(100% + var(--ph-speccer-measure-line-width));
|
|
1138
|
+
background: transparent;
|
|
1139
|
+
position: absolute;
|
|
1140
|
+
top: calc(36px - 5px);
|
|
1141
|
+
height: 10px;
|
|
1142
|
+
border-left: var(--ph-speccer-measure-line-width) solid;
|
|
1143
|
+
border-right: var(--ph-speccer-measure-line-width) solid;
|
|
1017
1144
|
}
|
|
1018
1145
|
.ph-speccer.speccer.measure.width.top::after {
|
|
1146
|
+
position: static;
|
|
1019
1147
|
content: attr(data-measure);
|
|
1148
|
+
display: flex;
|
|
1149
|
+
flex-direction: column;
|
|
1150
|
+
height: 36px;
|
|
1151
|
+
width: 100%;
|
|
1152
|
+
line-height: 18px;
|
|
1153
|
+
margin-bottom: auto;
|
|
1154
|
+
border-bottom: var(--ph-speccer-measure-line-width) solid;
|
|
1155
|
+
justify-content: flex-end;
|
|
1156
|
+
padding-bottom: 4px;
|
|
1157
|
+
}
|
|
1158
|
+
.ph-speccer.speccer.measure.width.bottom::before {
|
|
1159
|
+
content: '';
|
|
1160
|
+
display: block;
|
|
1161
|
+
width: calc(100% + var(--ph-speccer-measure-line-width));
|
|
1162
|
+
background: transparent;
|
|
1020
1163
|
position: absolute;
|
|
1021
|
-
|
|
1164
|
+
top: calc(100% - 36px - 5px);
|
|
1165
|
+
height: 10px;
|
|
1166
|
+
border-left: var(--ph-speccer-measure-line-width) solid;
|
|
1167
|
+
border-right: var(--ph-speccer-measure-line-width) solid;
|
|
1168
|
+
}
|
|
1169
|
+
.ph-speccer.speccer.measure.width.bottom::after {
|
|
1170
|
+
position: static;
|
|
1171
|
+
content: attr(data-measure);
|
|
1172
|
+
display: flex;
|
|
1173
|
+
height: 36px;
|
|
1174
|
+
width: 100%;
|
|
1175
|
+
line-height: 18px;
|
|
1176
|
+
margin-top: auto;
|
|
1177
|
+
flex-direction: column;
|
|
1178
|
+
border-top: var(--ph-speccer-measure-line-width) solid;
|
|
1179
|
+
justify-content: flex-start;
|
|
1180
|
+
padding-top: 4px;
|
|
1181
|
+
}
|
|
1182
|
+
.ph-speccer.speccer.measure.slim.height {
|
|
1183
|
+
width: var(--ph-speccer-measure-size);
|
|
1022
1184
|
}
|
|
1023
|
-
.ph-speccer.speccer.measure.height
|
|
1185
|
+
.ph-speccer.speccer.measure.slim.height::before {
|
|
1186
|
+
content: none !important;
|
|
1187
|
+
}
|
|
1188
|
+
.ph-speccer.speccer.measure.slim.height.left {
|
|
1024
1189
|
color: var(--ph-speccer-measure-color);
|
|
1025
|
-
border: var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color);
|
|
1190
|
+
border: var(--ph-speccer-measure-line-width) solid var(--ph-speccer-measure-color);
|
|
1026
1191
|
border-right: none;
|
|
1027
|
-
width: var(--ph-speccer-measure-size);
|
|
1028
1192
|
}
|
|
1029
|
-
.ph-speccer.speccer.measure.height.
|
|
1030
|
-
|
|
1193
|
+
.ph-speccer.speccer.measure.slim.height.right {
|
|
1194
|
+
color: var(--ph-speccer-measure-color);
|
|
1195
|
+
border: var(--ph-speccer-measure-line-width) solid var(--ph-speccer-measure-color);
|
|
1196
|
+
border-left: none;
|
|
1197
|
+
}
|
|
1198
|
+
.ph-speccer.speccer.measure.slim.height.left::after {
|
|
1031
1199
|
position: absolute;
|
|
1032
1200
|
top: 50%;
|
|
1201
|
+
width: auto;
|
|
1202
|
+
height: auto;
|
|
1203
|
+
margin: 0;
|
|
1204
|
+
white-space: nowrap;
|
|
1205
|
+
padding: 0;
|
|
1206
|
+
border: none;
|
|
1033
1207
|
left: calc(-100% - 20px - var(--ph-speccer-line-width));
|
|
1034
1208
|
transform: translateY(-50%) rotate(-90deg);
|
|
1035
1209
|
}
|
|
1036
|
-
.ph-speccer.speccer.measure.height.right {
|
|
1037
|
-
color: var(--ph-speccer-measure-color);
|
|
1038
|
-
border: var(--ph-speccer-line-width) solid var(--ph-speccer-measure-color);
|
|
1039
|
-
border-left: none;
|
|
1040
|
-
width: var(--ph-speccer-measure-size);
|
|
1041
|
-
}
|
|
1042
|
-
.ph-speccer.speccer.measure.height.right::after {
|
|
1043
|
-
content: attr(data-measure);
|
|
1210
|
+
.ph-speccer.speccer.measure.slim.height.right::after {
|
|
1044
1211
|
position: absolute;
|
|
1212
|
+
width: auto;
|
|
1213
|
+
height: auto;
|
|
1214
|
+
border: none;
|
|
1215
|
+
padding: 0;
|
|
1216
|
+
margin: 0;
|
|
1045
1217
|
top: 50%;
|
|
1218
|
+
white-space: nowrap;
|
|
1046
1219
|
left: calc(100% - var(--ph-speccer-measure-size));
|
|
1047
1220
|
transform: translateY(-50%) rotate(90deg);
|
|
1048
1221
|
}
|
|
1049
|
-
.ph-speccer.speccer.measure.
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
.ph-speccer.speccer.measure.
|
|
1222
|
+
.ph-speccer.speccer.measure.slim.width {
|
|
1223
|
+
height: var(--ph-speccer-measure-size);
|
|
1224
|
+
}
|
|
1225
|
+
.ph-speccer.speccer.measure.slim.width::before {
|
|
1226
|
+
content: none !important;
|
|
1227
|
+
}
|
|
1228
|
+
.ph-speccer.speccer.measure.slim.width.bottom {
|
|
1229
|
+
color: var(--ph-speccer-measure-color);
|
|
1230
|
+
border: var(--ph-speccer-measure-line-width) solid var(--ph-speccer-measure-color);
|
|
1231
|
+
border-top: none;
|
|
1232
|
+
}
|
|
1233
|
+
.ph-speccer.speccer.measure.slim.width.top {
|
|
1234
|
+
color: var(--ph-speccer-measure-color);
|
|
1235
|
+
border: var(--ph-speccer-measure-line-width) solid var(--ph-speccer-measure-color);
|
|
1236
|
+
border-bottom: none;
|
|
1237
|
+
}
|
|
1238
|
+
.ph-speccer.speccer.measure.slim.width.top::after {
|
|
1239
|
+
position: absolute;
|
|
1240
|
+
bottom: calc(100% + 5px);
|
|
1241
|
+
padding: 0;
|
|
1242
|
+
border: none;
|
|
1243
|
+
height: auto;
|
|
1244
|
+
}
|
|
1245
|
+
.ph-speccer.speccer.measure.slim.width.bottom::after {
|
|
1246
|
+
position: absolute;
|
|
1247
|
+
top: calc(100% + 5px);
|
|
1248
|
+
padding: 0;
|
|
1249
|
+
border: none;
|
|
1250
|
+
height: auto;
|
|
1251
|
+
}
|
|
1252
|
+
.ph-speccer.speccer.measure.slim.subtle.width.top,
|
|
1253
|
+
.ph-speccer.speccer.measure.slim.subtle.width.bottom,
|
|
1254
|
+
.ph-speccer.speccer.measure.slim.subtle.height.right,
|
|
1255
|
+
.ph-speccer.speccer.measure.slim.subtle.height.left {
|
|
1053
1256
|
border-style: dashed;
|
|
1054
1257
|
}
|
|
1055
|
-
.ph-speccer.speccer.measure.subtle.width.top {
|
|
1258
|
+
.ph-speccer.speccer.measure.slim.subtle.width.top {
|
|
1056
1259
|
border-bottom: none;
|
|
1057
1260
|
}
|
|
1058
|
-
.ph-speccer.speccer.measure.subtle.width.bottom {
|
|
1261
|
+
.ph-speccer.speccer.measure.slim.subtle.width.bottom {
|
|
1059
1262
|
border-top: none;
|
|
1060
1263
|
}
|
|
1061
|
-
.ph-speccer.speccer.measure.subtle.height.right {
|
|
1264
|
+
.ph-speccer.speccer.measure.slim.subtle.height.right {
|
|
1062
1265
|
border-left: none;
|
|
1063
1266
|
}
|
|
1064
|
-
.ph-speccer.speccer.measure.subtle.height.left {
|
|
1267
|
+
.ph-speccer.speccer.measure.slim.subtle.height.left {
|
|
1065
1268
|
border-right: none;
|
|
1066
1269
|
}
|
|
1067
1270
|
.ph-speccer.speccer.mark {
|
package/dist/speccer.d.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
type SpeccerFunctionType = () => void;
|
|
2
|
+
type SpeccerFeatureType = 'pin' | 'grid' | 'mark' | 'typography' | 'measure' | 'spacing';
|
|
3
|
+
type SpeccerPositionType = 'top' | 'left' | 'right' | 'bottom';
|
|
4
|
+
interface SpeccerOptionsInterface {
|
|
5
|
+
slug: string;
|
|
6
|
+
position: SpeccerPositionType;
|
|
7
|
+
type: SpeccerFeatureType;
|
|
8
|
+
pin?: {
|
|
9
|
+
bracket: boolean;
|
|
10
|
+
enclose: boolean;
|
|
11
|
+
subtle: boolean;
|
|
12
|
+
parent: boolean;
|
|
13
|
+
text: boolean;
|
|
14
|
+
useSVGLine: boolean;
|
|
15
|
+
useCurlyBrackets: boolean;
|
|
16
|
+
};
|
|
17
|
+
measure?: {
|
|
18
|
+
slim: boolean;
|
|
19
|
+
height: boolean;
|
|
20
|
+
width: boolean;
|
|
21
|
+
};
|
|
22
|
+
typography?: {
|
|
23
|
+
useSyntaxHighlighting: boolean;
|
|
24
|
+
};
|
|
25
|
+
spacing?: {
|
|
26
|
+
margin?: boolean;
|
|
27
|
+
padding?: boolean;
|
|
28
|
+
both?: boolean;
|
|
29
|
+
bound?: boolean;
|
|
30
|
+
};
|
|
31
|
+
grid?: {
|
|
32
|
+
toggle: string;
|
|
33
|
+
both?: boolean;
|
|
34
|
+
rows?: boolean;
|
|
35
|
+
columns?: boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
2
38
|
|
|
3
39
|
/**
|
|
4
40
|
* Extends the global Window interface to add custom properties.
|
|
@@ -35,30 +71,49 @@ declare global {
|
|
|
35
71
|
}
|
|
36
72
|
//# sourceMappingURL=global.d.ts.map
|
|
37
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Remove a speccer element by removing associated elements and SVG paths.
|
|
76
|
+
*
|
|
77
|
+
* This function removes any speccer elements linked to the specified element and
|
|
78
|
+
* also removes any SVG paths that might be associated with it.
|
|
79
|
+
*
|
|
80
|
+
* @param {HTMLElement} el - The HTML element to unpin.
|
|
81
|
+
* @returns {void} This function does not return a value.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const element = document.getElementById('my-element');
|
|
86
|
+
* if (element) {
|
|
87
|
+
* removeSpeccerElement(element);
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare const removeSpeccerElement: (el: HTMLElement) => void;
|
|
92
|
+
|
|
38
93
|
declare const grid: {
|
|
39
|
-
create: (targetElement: HTMLElement, styles: CSSStyleDeclaration, options:
|
|
40
|
-
element: (targetElement: HTMLElement) => Promise<void>;
|
|
94
|
+
create: (targetElement: HTMLElement, styles: CSSStyleDeclaration, options: SpeccerOptionsInterface) => Promise<void>;
|
|
95
|
+
element: (targetElement: HTMLElement, options?: SpeccerOptionsInterface | undefined) => Promise<void>;
|
|
41
96
|
};
|
|
42
97
|
declare const spacing: {
|
|
43
98
|
create: (text?: string | number, tag?: string) => HTMLElement;
|
|
44
|
-
element: (targetElement: HTMLElement) => Promise<void>;
|
|
99
|
+
element: (targetElement: HTMLElement, options?: SpeccerOptionsInterface | undefined) => Promise<void>;
|
|
45
100
|
};
|
|
46
101
|
declare const pin: {
|
|
47
|
-
createPinElement: (
|
|
48
|
-
pinElement: (targetElement: HTMLElement,
|
|
49
|
-
pinElements: (sectionElement: HTMLElement) => Promise<void>;
|
|
102
|
+
createPinElement: (content: string | undefined, options: SpeccerOptionsInterface, id?: string, n?: string) => HTMLElement;
|
|
103
|
+
pinElement: (targetElement: HTMLElement, parentElement: HTMLElement, content: string, options: SpeccerOptionsInterface) => Promise<string | void>;
|
|
104
|
+
pinElements: (sectionElement: HTMLElement, options?: SpeccerOptionsInterface | undefined) => Promise<void>;
|
|
50
105
|
};
|
|
51
106
|
declare const measure: {
|
|
52
|
-
create: (text
|
|
53
|
-
element: (targetElement: HTMLElement) => Promise<void>;
|
|
107
|
+
create: (text: (string | number) | undefined, options: SpeccerOptionsInterface, id: string, tag?: string) => HTMLElement;
|
|
108
|
+
element: (targetElement: HTMLElement, options?: SpeccerOptionsInterface | undefined) => Promise<void>;
|
|
54
109
|
};
|
|
55
110
|
declare const mark: {
|
|
56
|
-
create: (n?: string) => HTMLElement;
|
|
111
|
+
create: (id: string, n?: string) => HTMLElement;
|
|
57
112
|
element: (targetElement: HTMLElement) => Promise<void>;
|
|
58
113
|
};
|
|
59
114
|
declare const typography: {
|
|
60
|
-
create: (html: string,
|
|
61
|
-
element: (targetElement: HTMLElement) => Promise<void>;
|
|
115
|
+
create: (html: string, options: SpeccerOptionsInterface, id: string) => HTMLElement;
|
|
116
|
+
element: (targetElement: HTMLElement, options?: SpeccerOptionsInterface | undefined) => Promise<void>;
|
|
62
117
|
};
|
|
63
118
|
declare const modes: {
|
|
64
119
|
dom: (speccer: SpeccerFunctionType) => void;
|
|
@@ -68,4 +123,4 @@ declare const modes: {
|
|
|
68
123
|
};
|
|
69
124
|
declare const speccer: () => void;
|
|
70
125
|
|
|
71
|
-
export { speccer as default, grid, mark, measure, modes, pin, spacing, typography };
|
|
126
|
+
export { speccer as default, grid, mark, measure, modes, pin, removeSpeccerElement, spacing, typography };
|