Skip to content
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

Link Color: substitute the CSS Custom Property by the mechanism used in layout and duotone #31488

Closed
oandregal opened this issue May 5, 2021 · 0 comments · Fixed by #31524
Closed
Assignees
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@oandregal
Copy link
Member

The link color is an experimental feature a theme can opt-in. At the user level, it works by attaching --wp--style--color--link: <user selected value> to the block wrapper. At the global level, it works by outputting a new ruleset such as block selector { --wp--style--color--link: <theme_or_user_value>}. They work because the framework also outputs this rule <selector for links> { color: var(--wp--style--color--link, <fallback value>}, which we enqueue when the theme has support for theme.json or has opted-in for link color.

The link color is experimental for a few reasons, such as that it doesn't work for roles without unfiltered_html capabilities #25151 and that we were exploring how to target the inner contents of a block. The current iteration for inner block markup focus on two efforts: allowing blocks to serialize themselves the style properties to parts of its markup they want #28913 and the introduction of elements as a way to target structured inner elements via theme.json #29891 Additionally, we've recently introduced a mechanism to render some styles in the server and collocate <style> tags with the block that uses them, see layout #29335 and duotone #26752

With all this new data, we have an opportunity to improve and simplify how the link color works by making it work like layout and duotone and tapping into the elements mechanism.

@oandregal oandregal added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. CSS Styling Related to editor and front end styles, CSS-specific issues. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels May 5, 2021
@oandregal oandregal added this to 📥 To do in WordPress 5.8 Must Haves via automation May 5, 2021
WordPress 5.8 Must Haves automation moved this from 📥 To do to ✅ Done May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants