Skip to content

Commit ccb34d6

Browse files
authored
Merge pull request #301 from BeAPI/feature/admin-bar
Admin bar css variable
2 parents 92ff98e + d58a3b6 commit ccb34d6

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/scss/01-abstract/_variables.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ $breakpoints: (
110110
);
111111
// /!\ WARNING: If you use a breakpoint of 1280px, it causes a bug under Window Edge with a device pixel ratio higher than 1. Prefer to use the value 1279px.
112112

113-
// ----
114-
// wp admin bar
115-
// ----
116-
$wp-admin-bar-mobile-height: 46px;
117-
$wp-admin-bar-desktop-height: 32px;
118-
119113
// ----
120114
// border
121115
// ----

src/scss/03-base/_variables-css.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,20 @@
3333
--responsive--alignwide-width: calc(100% - #{$external-gutter * 2});
3434
--responsive--alignfull-width: 100%;
3535

36-
3736
/*
3837
* Animation speeds
3938
*/
4039
--speed: 1s;
4140

41+
/*
42+
* Admin bar
43+
*/
44+
--wp-admin-bar-height: 46px;
45+
4246
/*
4347
* Alignments breakpoints
4448
*/
49+
4550
@media screen and (min-width: #{$container-default + $external-gutter * 2}) {
4651
--responsive--aligndefault-width: #{$container-default};
4752
}
@@ -60,6 +65,14 @@
6065
/*
6166
* Global breakpoints
6267
*/
68+
69+
@include breakpoints(admin-bar) {
70+
/*
71+
* Admin bar
72+
*/
73+
--wp-admin-bar-height: 32px;
74+
}
75+
6376
@include breakpoints(md) {
6477
/*
6578
* Spacing

src/scss/08-template-parts/_header.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
}
165165

166166
.admin-bar &__inner {
167-
top: $wp-admin-bar-mobile-height;
167+
top: var(--wp-admin-bar-height);
168168
}
169169

170170
.scroll-up &__inner,
@@ -231,12 +231,6 @@
231231
}
232232
}
233233

234-
@include breakpoints(admin-bar) {
235-
.admin-bar &__inner {
236-
top: $wp-admin-bar-desktop-height;
237-
}
238-
}
239-
240234
@include breakpoints(lg) {
241235
.container {
242236
display: flex;

0 commit comments

Comments
 (0)