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-pseudo] ::first-letter should include currency #5099

Closed
maclockard opened this issue May 21, 2020 · 4 comments
Closed

[css-pseudo] ::first-letter should include currency #5099

maclockard opened this issue May 21, 2020 · 4 comments

Comments

@maclockard
Copy link

Currently ::first-letter is limited to punctuation and typographic letter unit. This covers many use cases, however, its not uncommon to also use currency at the start of a paragraph/sentence. It would be reasonable to assume that the styles to a currency symbol, for example it seems odd for 100 dollars to work but not $100.

@fantasai
Copy link
Collaborator

I guess the reasonable proposal here would be to include Symbols alongside Letters and Digits as possible first letters? That would pull out the dollar sign in your example.

I've never seen a specially-styled first symbol. You wouldn't happen to have examples where this would actually be useful?

@maclockard
Copy link
Author

The only example I have is a bit self serving, but I ran into this when trying to style specially formatted variables in code with a leading $ to have different styles for the $ then the rest of the variable. I couldn't added additional markup, so using the ::first-letter selector worked in some browsers, but not all.

I also think the example of a sentence with a mention of currency "$100 was the amount needed to..." would be awkward if this was formatted differently than all other sentences in a paragraph

@fantasai
Copy link
Collaborator

testcase

Seems like both Blink and WebKit include Symbols alongside Letters and Numbers, and it makes pretty good sense so I suggest we do it. Agenda+ to get WG approval.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-pseudo] ::first-letter should include currency, and agreed to the following:

  • RESOLVED: include symbols when looking for first-letter
The full IRC log of that discussion <dael> Topic: [css-pseudo] ::first-letter should include currency
<dael> github: https://github.com//issues/5099
<dael> Rossen_: Has a test case in it
<dael> fantasai: Prop is we include symbols along with letters and numbers when looking for first-letter
<dael> fantasai: Makes sense and we should do it. Otherwise if you start paragraph with a symbol there isn't a first-letter. Blink and WK do this
<dael> Rossen_: Any reasons why we shouldn't do it?
<tantek> should we include # also in case you start your paragraph with a hashtag?
<bradk> +1
<dael> Rossen_: Obj to inlcude symbols when looking for first-letter?
<dael> RESOLVED: include symbols when looking for first-letter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants