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

Support text-emphasis #2024

Open
lar-ry opened this issue Dec 15, 2023 · 3 comments
Open

Support text-emphasis #2024

lar-ry opened this issue Dec 15, 2023 · 3 comments
Labels
feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background

Comments

@lar-ry
Copy link

lar-ry commented Dec 15, 2023

I want these feature:

But these feature is not support on latest version 60.2

Thank you.

@liZe
Copy link
Member

liZe commented Dec 16, 2023

Hi!

writing-mode is already discussed in #577.

text-emphasis could be interesting, and should be quite "simple" to have. Interested in proposing a pull request?

@liZe liZe added the feature New feature that should be supported label Dec 16, 2023
@liZe liZe changed the title Could you support text-emphasis and writing-mode? Support text-emphasis Dec 16, 2023
@liZe liZe added the good first issue Issues that can be quite easily solved by Python developers with a good CSS background label Dec 16, 2023
@SrGitQ
Copy link

SrGitQ commented Jan 8, 2024

Hello! This is my first open-source contribution and I'm excited to be a part of it. I have some questions about how to implement these features.

I am working on the following properties:

  • text-emphasis
  • text-emphasis-style
  • text-emphasis-color
  • text-emphasis-position

I started to add text_emphasis_style in the css/validation/properties.py file and then in css/properties.py.INITIAL_VALUES here is my progress and doubts:

Code

css/validation/properties.py

# ln-1605
@property()
@single_keyword
def text_emphasis_style(keyword):
    return keyword in ('filled', 'open')

Is there a clear explanation about these decorators?
For this feature that can be manipulated as a general property text-emphasis and specific as text-emphasis-style, what are the recommendations to implement them?

css/properties.py.INITIAL_VALUES

# ln-191
'text_emphasis_style': 'none',

I added text_emphasis_style to INITIAL_VALUES dict, and I guess it needs to be added in INHERITED dict too, please confirm this.

testing

test_file.html

<style>
        p.ex1 {
            text-emphasis-style: filled; 
            text-emphasis-color: red;
        }
</style>
<p class="ex1">This is some text.</p>

logs.log

Ignored `text-emphasis-color: red` at 4:13, unknown property.

text-emphasis-style now is accepted...

This feature requires position changes, such as putting text above a text, vertical orientation, etc, what would be the process to add this feature?

Thank you for being patient.

@liZe
Copy link
Member

liZe commented Jan 28, 2024

Hi @SrGitQ

Sorry for the delay, and thanks for your code!

It’s often easier to review code using pull requests. You can open a draft pull request if your code isn’t ready yet.

Is there a clear explanation about these decorators?
For this feature that can be manipulated as a general property text-emphasis and specific as text-emphasis-style, what are the recommendations to implement them?

The decorators are documented in properties.py, but the easiest way to discover what they do is to look at other validators.

text-emphasis is a shorthand property, you’ll have to put it in expanders.py (text-decoration could be a good example in your case.)

I guess it needs to be added in INHERITED dict too, please confirm this.

Yes, it’s inherited.

text-emphasis-style now is accepted...

\o/

This feature requires position changes, such as putting text above a text, vertical orientation, etc, what would be the process to add this feature?

If text emphasis doesn’t change the layout (to be verified in the specification), you follow what’s done for text decoration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background
Projects
None yet
Development

No branches or pull requests

3 participants