-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
style.scss
128 lines (110 loc) · 3.22 KB
/
style.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
.edit-post-header {
height: $header-height;
padding: $grid-size-small 2px;
border-bottom: $border-width solid $light-gray-500;
background: $white;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
// The header should never be wider than the viewport, or buttons might be hidden. Especially relevant at high zoom levels. Related to https://core.trac.wordpress.org/ticket/47603#ticket.
max-width: 100vw;
z-index: z-index(".edit-post-header");
left: 0;
right: 0;
// Make toolbar sticky on larger breakpoints
@include break-zoomed-in {
height: $header-height;
top: 0;
position: sticky;
flex-wrap: nowrap;
}
// On mobile the main content area has to scroll, otherwise you can invoke the overscroll bounce on the non-scrolling container.
@include break-small {
position: fixed;
padding: $grid-size;
top: $admin-bar-height-big;
}
@include break-medium() {
top: $admin-bar-height;
body.is-fullscreen-mode & {
top: 0;
}
}
// Some browsers, most notably IE11, honor an older version of the flexbox spec
// which takes absolutely positioned items into account when calculating `space-between`.
// https://www.w3.org/TR/2012/WD-css3-flexbox-20120612/#abspos-flex-items
//
// This difference is causing our header layout to break when focused in IE11.
// Our focused region styles use an absolutely positioned :after pseudo element to draw an outline,
// and IE11 is adding space between it and our last real child, shifting righthand UI elements
// to the left. For a workaround, we change the flex order to move the undesired spacing to the middle
// where it is no longer noticeable.
> .edit-post-header__settings {
order: 1;
// Restore default order for all other browsers
@supports (position: sticky) {
order: initial;
}
}
}
@include editor-left(".edit-post-header");
.edit-post-header__toolbar {
display: flex;
}
.edit-post-header__settings {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
}
.edit-post-header .components-button {
// Header toggle buttons.
&.is-toggled {
color: $white;
background: $dark-gray-500;
margin: 1px;
padding: 7px;
}
// The !important in this ruleset need to override the pile of :not() selectors used in the icon-button.
&.is-toggled:hover,
&.is-toggled:focus {
box-shadow: 0 0 0 $border-width $dark-gray-500, inset 0 0 0 $border-width $white !important;
color: $white !important;
background: $dark-gray-500 !important;
}
// Make editor header bar buttons bigger to match IconButtons.
&.editor-post-save-draft,
&.editor-post-switch-to-draft,
&.editor-post-preview,
&.editor-post-publish-button,
&.editor-post-publish-panel__toggle {
margin: 2px;
height: 33px;
line-height: 32px;
font-size: $default-font-size;
}
&.editor-post-save-draft,
&.editor-post-switch-to-draft {
padding: 0 5px;
@include break-small() {
padding: 0 12px;
}
}
&.editor-post-preview,
&.editor-post-publish-button,
&.editor-post-publish-panel__toggle {
padding: 0 5px 2px;
@include break-small() {
padding: 0 12px 2px;
}
}
@include break-medium() {
&.editor-post-preview {
margin: 0 3px 0 12px;
}
&.editor-post-publish-button,
&.editor-post-publish-panel__toggle {
margin: 0 12px 0 3px;
}
}
}