-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Toolbar color schemes on front end without global variable #11354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sabernhardt
wants to merge
12
commits into
WordPress:trunk
Choose a base branch
from
sabernhardt:toolbar-sass-front-end
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3700f88
Extract the admin bar styles into a mixin.
johnbillion 8a7542d
Introduce a separate `admin_bar_url` property for registered colour s…
johnbillion ab9a3f1
Merge branch 'WordPress:trunk' into toolbar-sass-front-end
sabernhardt 4eeb0b7
revert unit test
sabernhardt ba355f0
Simplify admin-bar.php function
sabernhardt f225767
Revert changes to `wp_admin_css_color()`
sabernhardt b0682e7
Check array properly
sabernhardt b97f202
more consistent
sabernhardt a005035
Remove default `false` argument for version
sabernhardt fa065da
Assign list of core color schemes to a variable for readability
sabernhardt 10eda66
Merge branch 'WordPress:trunk' into toolbar-sass-front-end
sabernhardt 7948757
Merge branch 'WordPress:trunk' into toolbar-sass-front-end
sabernhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| @forward 'variables' show $scheme-name, $base-color, $body-background, $button-color, $custom-welcome-panel, $dashboard-accent-1, $dashboard-accent-2, $dashboard-icon-background, $form-checked, $highlight-color, $icon-color, $link, $link-focus, $low-contrast-theme, $menu-bubble-text, $menu-collapse-focus-icon, $menu-collapse-text, $menu-highlight-background, $menu-highlight-icon, $menu-highlight-text, $menu-submenu-text, $menu-submenu-focus-text, $menu-submenu-background, $notification-color, $text-color; | ||
| @use 'variables'; | ||
|
|
||
| @mixin styles() { | ||
|
|
||
| /* Admin Bar */ | ||
|
|
||
| #wpadminbar { | ||
| color: variables.$menu-text; | ||
| background: variables.$menu-background; | ||
| } | ||
|
|
||
| #wpadminbar .ab-item, | ||
| #wpadminbar a.ab-item, | ||
| #wpadminbar > #wp-toolbar span.ab-label, | ||
| #wpadminbar > #wp-toolbar span.noticon { | ||
| color: variables.$menu-text; | ||
| } | ||
|
|
||
| #wpadminbar .ab-icon, | ||
| #wpadminbar .ab-icon:before, | ||
| #wpadminbar .ab-item:before, | ||
| #wpadminbar .ab-item:after { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
| #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item, | ||
| #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus, | ||
| #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, | ||
| #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item, | ||
| #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { | ||
| color: variables.$menu-submenu-focus-text; | ||
| background: variables.$menu-submenu-background; | ||
| } | ||
|
|
||
| #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label, | ||
| #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label, | ||
| #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar:not(.mobile) li:hover .ab-icon:before, | ||
| #wpadminbar:not(.mobile) li:hover .ab-item:before, | ||
| #wpadminbar:not(.mobile) li:hover .ab-item:after, | ||
| #wpadminbar:not(.mobile) li:hover #adminbarsearch:before { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
|
|
||
| /* Admin Bar: submenu */ | ||
|
|
||
| #wpadminbar .menupop .ab-sub-wrapper { | ||
| background: variables.$menu-submenu-background; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks .menupop ul.ab-sub-secondary, | ||
| #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu { | ||
| background: variables.$menu-submenu-background-alt; | ||
| } | ||
|
|
||
| #wpadminbar .ab-submenu .ab-item, | ||
| #wpadminbar .quicklinks .menupop ul li a, | ||
| #wpadminbar .quicklinks .menupop.hover ul li a, | ||
| #wpadminbar.nojs .quicklinks .menupop:hover ul li a { | ||
| color: variables.$menu-submenu-text; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks li .blavatar, | ||
| #wpadminbar .menupop .menupop > .ab-item:before { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks .menupop ul li a:hover, | ||
| #wpadminbar .quicklinks .menupop ul li a:focus, | ||
| #wpadminbar .quicklinks .menupop ul li a:hover strong, | ||
| #wpadminbar .quicklinks .menupop ul li a:focus strong, | ||
| #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a, | ||
| #wpadminbar .quicklinks .menupop.hover ul li a:hover, | ||
| #wpadminbar .quicklinks .menupop.hover ul li a:focus, | ||
| #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, | ||
| #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, | ||
| #wpadminbar li:hover .ab-icon:before, | ||
| #wpadminbar li:hover .ab-item:before, | ||
| #wpadminbar li a:focus .ab-icon:before, | ||
| #wpadminbar li .ab-item:focus:before, | ||
| #wpadminbar li .ab-item:focus .ab-icon:before, | ||
| #wpadminbar li.hover .ab-icon:before, | ||
| #wpadminbar li.hover .ab-item:before, | ||
| #wpadminbar li:hover #adminbarsearch:before, | ||
| #wpadminbar li #adminbarsearch.adminbar-focused:before { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks li a:hover .blavatar, | ||
| #wpadminbar .quicklinks li a:focus .blavatar, | ||
| #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar, | ||
| #wpadminbar .menupop .menupop > .ab-item:hover:before, | ||
| #wpadminbar.mobile .quicklinks .ab-icon:before, | ||
| #wpadminbar.mobile .quicklinks .ab-item:before { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar.mobile .quicklinks .hover .ab-icon:before, | ||
| #wpadminbar.mobile .quicklinks .hover .ab-item:before { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
|
|
||
| /* Admin Bar: search */ | ||
|
|
||
| #wpadminbar #adminbarsearch:before { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
| #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus { | ||
| color: variables.$menu-text; | ||
| background: variables.$adminbar-input-background; | ||
| } | ||
|
|
||
|
|
||
| /* Admin Bar: my account */ | ||
|
|
||
| #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { | ||
| border-color: variables.$adminbar-avatar-frame; | ||
| background-color: variables.$adminbar-avatar-frame; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-user-info .display-name { | ||
| color: variables.$menu-text; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-user-info a:hover .display-name { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-user-info .username { | ||
| color: variables.$menu-submenu-text; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| @use 'variables'; | ||
| @use 'mixins'; | ||
| @use 'tokens'; | ||
| @use 'admin-bar' as admin-bar; | ||
|
|
||
| /** | ||
| * This function name uses British English to maintain backward compatibility, as developers | ||
|
|
@@ -383,158 +384,7 @@ ul#adminmenu > li.current > a.current:after { | |
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| /* Admin Bar */ | ||
|
|
||
| #wpadminbar { | ||
| color: variables.$menu-text; | ||
| background: variables.$menu-background; | ||
| } | ||
|
|
||
| #wpadminbar .ab-item, | ||
| #wpadminbar a.ab-item, | ||
| #wpadminbar > #wp-toolbar span.ab-label, | ||
| #wpadminbar > #wp-toolbar span.noticon { | ||
| color: variables.$menu-text; | ||
| } | ||
|
|
||
| #wpadminbar .ab-icon, | ||
| #wpadminbar .ab-icon:before, | ||
| #wpadminbar .ab-item:before, | ||
| #wpadminbar .ab-item:after { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
| #wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item, | ||
| #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus, | ||
| #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, | ||
| #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item, | ||
| #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { | ||
| color: variables.$menu-submenu-focus-text; | ||
| background: variables.$menu-submenu-background; | ||
| } | ||
|
|
||
| #wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label, | ||
| #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label, | ||
| #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar:not(.mobile) li:hover .ab-icon:before, | ||
| #wpadminbar:not(.mobile) li:hover .ab-item:before, | ||
| #wpadminbar:not(.mobile) li:hover .ab-item:after, | ||
| #wpadminbar:not(.mobile) li:hover #adminbarsearch:before { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
|
|
||
| /* Admin Bar: submenu */ | ||
|
|
||
| #wpadminbar .menupop .ab-sub-wrapper { | ||
| background: variables.$menu-submenu-background; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks .menupop ul.ab-sub-secondary, | ||
| #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu { | ||
| background: variables.$menu-submenu-background-alt; | ||
| } | ||
|
|
||
| #wpadminbar .ab-submenu .ab-item, | ||
| #wpadminbar .quicklinks .menupop ul li a, | ||
| #wpadminbar .quicklinks .menupop.hover ul li a, | ||
| #wpadminbar.nojs .quicklinks .menupop:hover ul li a { | ||
| color: variables.$menu-submenu-text; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks li .blavatar, | ||
| #wpadminbar .menupop .menupop > .ab-item:before { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks .menupop ul li a:hover, | ||
| #wpadminbar .quicklinks .menupop ul li a:focus, | ||
| #wpadminbar .quicklinks .menupop ul li a:hover strong, | ||
| #wpadminbar .quicklinks .menupop ul li a:focus strong, | ||
| #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a, | ||
| #wpadminbar .quicklinks .menupop.hover ul li a:hover, | ||
| #wpadminbar .quicklinks .menupop.hover ul li a:focus, | ||
| #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, | ||
| #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, | ||
| #wpadminbar li:hover .ab-icon:before, | ||
| #wpadminbar li:hover .ab-item:before, | ||
| #wpadminbar li a:focus .ab-icon:before, | ||
| #wpadminbar li .ab-item:focus:before, | ||
| #wpadminbar li .ab-item:focus .ab-icon:before, | ||
| #wpadminbar li.hover .ab-icon:before, | ||
| #wpadminbar li.hover .ab-item:before, | ||
| #wpadminbar li:hover #adminbarsearch:before, | ||
| #wpadminbar li #adminbarsearch.adminbar-focused:before { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar .quicklinks li a:hover .blavatar, | ||
| #wpadminbar .quicklinks li a:focus .blavatar, | ||
| #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar, | ||
| #wpadminbar .menupop .menupop > .ab-item:hover:before, | ||
| #wpadminbar.mobile .quicklinks .ab-icon:before, | ||
| #wpadminbar.mobile .quicklinks .ab-item:before { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar.mobile .quicklinks .hover .ab-icon:before, | ||
| #wpadminbar.mobile .quicklinks .hover .ab-item:before { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
|
|
||
| /* Admin Bar: search */ | ||
|
|
||
| #wpadminbar #adminbarsearch:before { | ||
| color: variables.$menu-icon; | ||
| } | ||
|
|
||
| #wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input:focus { | ||
| color: variables.$menu-text; | ||
| background: variables.$adminbar-input-background; | ||
| } | ||
|
|
||
| /* Admin Bar: recovery mode */ | ||
|
|
||
| #wpadminbar #wp-admin-bar-recovery-mode { | ||
| color: variables.$adminbar-recovery-exit-text; | ||
| background-color: variables.$adminbar-recovery-exit-background; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-recovery-mode .ab-item, | ||
| #wpadminbar #wp-admin-bar-recovery-mode a.ab-item { | ||
| color: variables.$adminbar-recovery-exit-text; | ||
| } | ||
|
|
||
| #wpadminbar .ab-top-menu > #wp-admin-bar-recovery-mode.hover >.ab-item, | ||
| #wpadminbar.nojq .quicklinks .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus, | ||
| #wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode:hover > .ab-item, | ||
| #wpadminbar:not(.mobile) .ab-top-menu > #wp-admin-bar-recovery-mode > .ab-item:focus { | ||
| color: variables.$adminbar-recovery-exit-text; | ||
| background-color: variables.$adminbar-recovery-exit-background-alt; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The recovery mode CSS is removed here but isn't added to (Props Claude.) |
||
|
|
||
| /* Admin Bar: my account */ | ||
|
|
||
| #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { | ||
| border-color: variables.$adminbar-avatar-frame; | ||
| background-color: variables.$adminbar-avatar-frame; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-user-info .display-name { | ||
| color: variables.$menu-text; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-user-info a:hover .display-name { | ||
| color: variables.$menu-submenu-focus-text; | ||
| } | ||
|
|
||
| #wpadminbar #wp-admin-bar-user-info .username { | ||
| color: variables.$menu-submenu-text; | ||
| } | ||
| @include admin-bar.styles(); | ||
|
|
||
|
|
||
| /* Pointers */ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #52accc, | ||
| $icon-color: #e5f8ff, | ||
| $highlight-color: #096484, | ||
| $menu-submenu-text: #e2ecf1, | ||
| $menu-submenu-focus-text: #fff, | ||
| $menu-submenu-background: #4796b3, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #59524c, | ||
| $highlight-color: #c7a589, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #523f6d, | ||
| $icon-color: #ece6f6, | ||
| $highlight-color: #a3b745, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #e5e5e5, | ||
| $icon-color: #999, | ||
| $text-color: #333, | ||
| $highlight-color: #04a4cc, | ||
| $menu-submenu-background: #fff, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #363b3f, | ||
| $highlight-color: #e14d43, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #1e1e1e, | ||
| $highlight-color: #3858e9, | ||
| $menu-submenu-focus-text: #7b90ff, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| @use "../_admin-bar.scss" as admin-bar with ( | ||
| $base-color: #738e96, | ||
| $icon-color: #f2fcff, | ||
| $highlight-color: #9ebaa0, | ||
| ); | ||
|
|
||
| @include admin-bar.styles(); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Claude, this list is overly broad. It can be reduced to be more truthful about what is being used.
(Props Claude.)