Skip to content

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

Closed

Description

@maclockard

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.

Activity

  1. fantasai commented on Sep 11, 2020

    @fantasai
    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?

  2. maclockard commented on Sep 14, 2020

    @maclockard
    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

  3. fantasai commented on Dec 31, 2020

    @fantasai
    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.

  4. css-meeting-bot commented on Jan 13, 2021

    @css-meeting-bot
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions