WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 154302
Web Inspector: add CSS variables for common border/background colors
https://bugs.webkit.org/show_bug.cgi?id=154302
Summary
Web Inspector: add CSS variables for common border/background colors
Matt Baker
Reported
2016-02-16 11:35:52 PST
* SUMMARY Add CSS variables for common border/background colors. The following colors are used in dozens of places and should be CSS variables: --border-color: hsl(0, 0%, 70%); --border-inactive-color: hsl(0, 0%, 85%); --panel-background-color: hsl(0, 0%, 94%);
Attachments
[Patch] Proposed Fix
(33.23 KB, patch)
2016-02-16 11:46 PST
,
Matt Baker
no flags
Details
Formatted Diff
Diff
[Patch] Proposed Fix
(28.77 KB, patch)
2016-02-16 21:43 PST
,
Matt Baker
no flags
Details
Formatted Diff
Diff
[Image] body.window-inactive * {} vs. body.window-inactive {}
(622.08 KB, image/png)
2016-02-16 23:35 PST
,
Matt Baker
no flags
Details
[Patch] Proposed Fix
(28.71 KB, patch)
2016-02-17 11:55 PST
,
Matt Baker
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-02-16 11:36:22 PST
<
rdar://problem/24680944
>
Matt Baker
Comment 2
2016-02-16 11:46:01 PST
Created
attachment 271459
[details]
[Patch] Proposed Fix
Timothy Hatcher
Comment 3
2016-02-16 11:50:59 PST
Comment on
attachment 271459
[details]
[Patch] Proposed Fix In theory we can just have —border-color, and override the color var in body.window-inactive { }. Then delete all the rules with body.window-inactive!
Matt Baker
Comment 4
2016-02-16 21:43:24 PST
Created
attachment 271535
[details]
[Patch] Proposed Fix
Matt Baker
Comment 5
2016-02-16 21:44:47 PST
(In reply to
comment #3
)
> Comment on
attachment 271459
[details]
> [Patch] Proposed Fix > > In theory we can just have —border-color, and override the color var in > body.window-inactive { }. Then delete all the rules with > body.window-inactive!
Worked perfectly! It felt great removing all those rules.
Timothy Hatcher
Comment 6
2016-02-16 22:30:25 PST
Comment on
attachment 271535
[details]
[Patch] Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=271535&action=review
> Source/WebInspectorUI/UserInterface/Views/Variables.css:58 > +body.window-inactive * {
You should be able to remove the *. Vars are inherited, so it can stay on the body.
Matt Baker
Comment 7
2016-02-16 23:35:19 PST
Created
attachment 271543
[details]
[Image] body.window-inactive * {} vs. body.window-inactive {} Without selecting all elements "*", a few borders aren't styled correctly. Weird.
Joseph Pecoraro
Comment 8
2016-02-17 01:08:39 PST
Comment on
attachment 271535
[details]
[Patch] Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=271535&action=review
> Source/WebInspectorUI/UserInterface/Views/Variables.css:29 > + --z-index-resizer: 256;`
This character looks errant. cq- to fix it.
Joseph Pecoraro
Comment 9
2016-02-17 01:13:47 PST
(In reply to
comment #7
)
> Created
attachment 271543
[details]
> [Image] body.window-inactive * {} vs. body.window-inactive {} > > Without selecting all elements "*", a few borders aren't styled correctly. > Weird.
When you inspect the nav bar / other things that have a darker border, what is the cascade? I assume that this is just a specificity issue, and that adding the * gave this just enough extra specificity? Otherwise, I don't see why it would change things. -- Using CSS Variables allowed us to reduce 23, often complex, rules down to 1. This is a great story for custom properties and their cascade rules.
Timothy Hatcher
Comment 10
2016-02-17 07:11:27 PST
(In reply to
comment #9
)
> (In reply to
comment #7
) > > Created
attachment 271543
[details]
> > [Image] body.window-inactive * {} vs. body.window-inactive {} > > > > Without selecting all elements "*", a few borders aren't styled correctly. > > Weird. > > When you inspect the nav bar / other things that have a darker border, what > is the cascade? I assume that this is just a specificity issue, and that > adding the * gave this just enough extra specificity? Otherwise, I don't see > why it would change things.
Note you might need my most recent changes for the variable rules to show up in the sidebar. Does !important on the --border-color help?
> Using CSS Variables allowed us to reduce 23, often complex, rules down to 1. > This is a great story for custom properties and their cascade rules.
Yep!
Matt Baker
Comment 11
2016-02-17 11:53:56 PST
(In reply to
comment #10
)
> (In reply to
comment #9
) > > (In reply to
comment #7
) > > > Created
attachment 271543
[details]
> > > [Image] body.window-inactive * {} vs. body.window-inactive {} > > > > > > Without selecting all elements "*", a few borders aren't styled correctly. > > > Weird. > > > > When you inspect the nav bar / other things that have a darker border, what > > is the cascade? I assume that this is just a specificity issue, and that > > adding the * gave this just enough extra specificity? Otherwise, I don't see > > why it would change things. > > Note you might need my most recent changes for the variable rules to show up > in the sidebar. Does !important on the --border-color help?
Sadly, no.
Matt Baker
Comment 12
2016-02-17 11:55:30 PST
Created
attachment 271573
[details]
[Patch] Proposed Fix
WebKit Commit Bot
Comment 13
2016-02-17 12:29:49 PST
Comment on
attachment 271573
[details]
[Patch] Proposed Fix Clearing flags on attachment: 271573 Committed
r196713
: <
http://trac.webkit.org/changeset/196713
>
WebKit Commit Bot
Comment 14
2016-02-17 12:29:55 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug