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

[css-text-4] inline (horizontal) text-underline-offset #4517

Closed
spacecakes opened this issue Nov 19, 2019 · 2 comments
Closed

[css-text-4] inline (horizontal) text-underline-offset #4517

spacecakes opened this issue Nov 19, 2019 · 2 comments
Labels
Closed as Duplicate Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-text-decor-4

Comments

@spacecakes
Copy link

spacecakes commented Nov 19, 2019

CSS Text Decoration Module Level 4

Note: 'horizontal' here refers to the inline dimension in the writing mode of western languages.

I would like a way to control offset in the inline dimension too. Maybe the text-underline-offset property could be a shorthand for both vertical and horizontal offsets, so that we’re also able to set them separately. If no second value is specified, the there will be no horizontal offset, which is what you'd normally want.

I have a perfect use case for this where the designer has chosen a thick, semi-transparent and slightly offset (both x, y) underline that resembles that of a highlighter marker.

Example:
Screenshot 2019-11-19 at 08 04 46

This was done using some background trickery to also get it to wrap along with the text:

display: inline;
word-break: break-word;
background-image: linear-gradient(
rgba(36,148,187,0.25),
rgba(36,148,187,0.25));
background-position: bottom 9px right -20px;
background-size: 100% 30%;
background-repeat: no-repeat;
padding: 10px;
margin: -10px;

This works well, but a property to control offset in both directions would save me a lot of code.

@fantasai
Copy link
Collaborator

#4557 seems to be the same request.

@spacecakes
Copy link
Author

#4557 seems to be the same request.

Sure is!

@fantasai fantasai closed this as completed Sep 2, 2022
@fantasai fantasai added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Duplicate Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-text-decor-4
Projects
None yet
Development

No branches or pull requests

2 participants