Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Themes.css - Add Custom Props#14

Open
fwazeter wants to merge 40 commits intoryelle:try/custom-propertiesryelle/wordpress-develop:try/custom-propertiesfrom
fwazeter:themes-cssfwazeter/wordpress-develop:themes-cssCopy head branch name to clipboard
Open

Themes.css - Add Custom Props#14
fwazeter wants to merge 40 commits intoryelle:try/custom-propertiesryelle/wordpress-develop:try/custom-propertiesfrom
fwazeter:themes-cssfwazeter/wordpress-develop:themes-cssCopy head branch name to clipboard

Conversation

@fwazeter
Copy link

@fwazeter fwazeter commented Aug 20, 2021

Replaced static color values in wp-admin/css/themes.css with CSS custom properties. If no existing custom property in wp-includes/css/custom-properties , a new custom property was created. On colors using rgba() SOME do not render associated custom property unless a fallback is explicitly stated. Lines 60, 84, 163, 295, 368 and 570 are confirmed examples where not setting an explicit fallback color resulted in no color rendering.

Trac ticket: https://core.trac.wordpress.org/ticket/49930

Replaced static color values in wp-admin/css/themes.css with CSS custom properties.

If no existing custom property in wp-includes/css/custom-properties , a new custom property was created.
@fwazeter fwazeter changed the title Initial Replacement of Static Colors in Theme.css with Custom Props Themes.css Aug 20, 2021
@fwazeter fwazeter changed the title Themes.css Themes.css - Add Custom Props Aug 20, 2021
fwazeter and others added 18 commits August 20, 2021 00:17
Fixed missing # in hex color (line 159, custom-properties) & switched new custom prop from general --wp-admin to --wp-admin--themes (line 54 to line 145 custom properties), line 175 & 180 themes.css
Converting static colors to custom props in /wp-admin/css/customize-nav-menus.css .

We're getting a lot of overlap of common colors for elements, experimented with putting colors explicitly from WP color palette as base props to be used by more specific props.
Moved custom props to themes.css to follow ryelle's convention for now, since there are a ton of them here.
Added customize-preview to this PR because it's a small file. Even though it's small with only ~11 color values, it adds a lot of different custom props.
@fwazeter fwazeter changed the title Themes.css - Add Custom Props Themes.css - Add Custom Props [WIP - cleaning up a few things] Aug 21, 2021
Went back and refined with a more component based approach. Put themes.css specific custom props at top of themes.css following --wp-admin--admin-menu precedent.
Changed naming conventions to be more based on the components most used throughout the themes.css file.
@fwazeter fwazeter changed the title Themes.css - Add Custom Props [WIP - cleaning up a few things] Themes.css - Add Custom Props Aug 23, 2021
fwazeter and others added 5 commits August 23, 2021 10:29
Fixing git - files didn't get reconciled in the way expected. Manual restored non-edited files from this branch.
Weird spacing change not reflecting in local code editor that is not an intended change.
Spacing tab added on four lines that was never intented.
Corrected minor spacing.
@fwazeter
Copy link
Author

fwazeter commented Aug 26, 2021

Working On: Moving custom props into custom-properties, double checking odd rgba() occurrence bug noted earlier. Removing fallback colors.

@ryelle ryelle added the [Status] In Progress PR author is still working on this label Sep 22, 2021
fwazeter and others added 5 commits October 14, 2021 19:29
-Moved custom props from themes.css to custom-properties.css , removed all fallback colors, converted box-shadows to contain whole value (rather than just color), set properties for background-color: none / transparent, etc.
@fwazeter
Copy link
Author

Commenting here for easier readability: last commit removed all fallback colors, moved the custom props from themes.css to custom-properties, and made some tweaks, such as including the whole value of a box-shadow in the custom prop rather than just color, in reference to commentary on other PR's about box-shadows.

Original old RGBA fallbacks were removed as well.

Additionally, set custom props for some background / border-color that had none or transparent so that they are editable since logic would dictate that although the default is none or transparent, it's something someone might want to manipulate. Left out border: none; since that might imply not just color.

@ryelle ryelle removed the [Status] In Progress PR author is still working on this label Oct 21, 2021
Comment on lines +218 to +235
/* black grayscale rgba # = 0, 0, 0, # */
--wp-admin--themes--black-0: rgba(0, 0, 0, 0);
--wp-admin--themes--black-05: rgba(0, 0, 0, 0.05);
--wp-admin--themes--black-2: rgba(0, 0, 0, 0.2);
--wp-admin--themes--black-5: rgba(0, 0, 0, 0.5);
--wp-admin--themes--black-6: rgba(0, 0, 0, 0.6);
--wp-admin--themes--black-7: rgba(0, 0, 0, 0.7);

/* white grayscale rgba */
--wp-admin--themes--white-65: rgba(255, 255, 255, 0.65);
--wp-admin--themes--white-7: rgba(246, 247, 247, 0.7);
--wp-admin--themes--white-9: rgba(240, 240, 241, 0.9);

/* unique rgba colors */
--wp-admin--themes--alpha-dark: rgba(44, 51, 56, 0.7);
--wp-admin--themes--alpha-gray: rgba(140, 143, 148, 0.1);
--wp-admin--themes--blue: rgba(34, 113, 177, 0.8);
--wp-admin--themes--light-blue: rgba(79, 148, 212, 0.8);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part we've been avoiding using the color name in the properties. Rather than creating these intermediate properties and using them later, could you use them directly below?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing!

Comment on lines +72 to +75
--wp-admin--radio--color--focus: #1d2327;
--wp-admin--radio--border--checked: #8c8f94;
--wp-admin--radio--border--focus: #4f94d4;
--wp-admin--radio--box-shadow: var(--wp-admin--themes--blue);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't radio controls, it's for the buttons here:

Screen Shot 2021-10-21 at 5 34 27 PM

I think these properties should be either merged with button properties (if they exist), or change the name to use button for the location.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - leaving them named as radio in either case would be confusing, case in point being that I couldn't locate that control you brought up and thought they were a hidden / optional radio button based on the property name.

--wp-admin--themes--icon--shadow--hover: #4f94d4;
--wp-admin--themes--icon--background--disabled: var(--wp-admin--surface--border);

/* Theme Card */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these card properties be moved to a more generic card set? Or maybe it could use the surface properties?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which would you prefer as a best case? More generic card set or just inherit the surface properties directly? I tried to break up the file into components as much as possible to make it slightly easier to dig through, so I'd lean more towards generic card set personally.

@ryelle ryelle added the [Status] In Progress PR author is still working on this label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] In Progress PR author is still working on this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.