-
Notifications
You must be signed in to change notification settings - Fork 4k
/
editor.scss
149 lines (125 loc) · 3.29 KB
/
editor.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Editor specific styles for Social Links.
.wp-block-social-links {
div.block-editor-url-input {
display: inline-block;
margin-left: $grid-unit-10;
}
}
// Prevent toolbar from jumping when selecting / hovering a link.
.wp-social-link:hover {
transform: none;
}
.editor-styles-wrapper .wp-block-social-links {
padding: 0;
}
// Placeholder/setup state.
.wp-block-social-links__social-placeholder {
display: flex;
opacity: 0.8;
list-style: none;
// Use the first link to set the height.
> .wp-social-link {
// Use !important to keep the selector simple.
padding-left: 0 !important;
margin-left: 0 !important;
padding-right: 0 !important;
margin-right: 0 !important;
width: 0 !important;
visibility: hidden;
}
// Wrap the remaining placeholders in a container so the plus can overlap.
> .wp-block-social-links__social-placeholder-icons {
display: flex;
}
& + .block-list-appender,
.wp-social-link {
padding: 0.25em;
.is-style-pill-shape & {
padding-left: calc((2/3) * 1em);
padding-right: calc((2/3) * 1em);
}
.is-style-logos-only & {
padding: 0;
}
}
.wp-social-link::before {
content: "";
display: block;
width: 1em;
height: 1em;
border-radius: $radius-round;
.is-style-logos-only & {
background: currentColor;
}
}
}
// Selected placeholder state.
.wp-block-social-links .wp-block-social-links__social-prompt {
list-style: none;
order: 2; // Move after the appender button. Because this element is non-interactive, it does not affect tab order.
// Show as block UI.
font-family: $default-font;
font-size: $default-font-size;
line-height: $button-size-small;
margin-top: auto;
margin-bottom: auto;
cursor: default;
padding-right: $grid-unit-10;
& + .block-list-appender {
margin-right: $grid-unit-10;
padding: 0.25em;
}
}
// Polish the Appender.
.wp-block-social-links .block-list-appender {
// Match the overall silhouette of social links.
margin: 4px auto 4px 0;
border-radius: 9999px; // This works as both circular and pill shapes.
// Treat just like a social icon.
.block-editor-inserter {
display: flex;
align-items: center;
justify-content: center;
font-size: inherit;
width: 1em;
height: 1em;
}
// Duplicate the font sizes from style.scss to size the appender.
.has-small-icon-size & {
font-size: 16px; // 16 makes for a quarter-padding that keeps the icon centered.
}
// Normal/default.
.has-normal-icon-size & {
font-size: 24px;
}
// Large.
.has-large-icon-size & {
font-size: 36px;
}
// Huge.
.has-huge-icon-size & {
font-size: 48px;
}
&::before {
content: none;
}
}
// Center flex items. This has an equivalent in style.scss.
.wp-block[data-align="center"] > .wp-block-social-links {
justify-content: center;
}
// Improve the preview, ensure buttons are fully opaque despite being disabled.
// @todo: Look at improving the preview component to make this unnecessary.
.block-editor-block-preview__content .components-button:disabled {
opacity: 1;
}
// Unconfigured placeholder links are semitransparent.
.wp-social-link.wp-social-link__is-incomplete {
opacity: 0.5;
@include reduce-motion("transition");
}
.wp-block-social-links .is-selected .wp-social-link__is-incomplete,
.wp-social-link.wp-social-link__is-incomplete:hover,
.wp-social-link.wp-social-link__is-incomplete:focus {
opacity: 1;
}