-
Notifications
You must be signed in to change notification settings - Fork 711
[css-text] Decimal digit transforms #9877
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
Comments
AH's property presumably has use-cases to justify what it's doing. Could you elaborate on the use-cases for your altered proposal? |
It’s mostly the same use cases but limited to what is actually in scope of Several system APIs provide similar functions, e.g. Win32 calls it native digit shapes and provides unidirectional conversion towards local forms only. Background and plansI’m trying to explore how numeric data is presented: How much of it is styling and which part of CSS is best suited to deal with it, if any. Ultimately, I want CSS to be able to express various number and value formatting to support things like openui/open-ui#499 declaratively without the need for scripting.
|
Unicode has a character property to record its numeric value. This is mostly used for script-specific decimal digits, but also for precomposed vulgar fractions and other numerals. The relevant character classes are
Nd
Decimal Number,Nl
Letter Number andNo
Other Number.Antenna House Formatter supports a custom property
number-transform
. It does not just change the digit glyph, but the whole number. Besides Japanese-specifickansuji
keywords, it accordingly accepts<list-style-type>
as a value (and<string>
).I would like to propose something simpler, i.e. two new keywords – to be bikeshedded – for the
text-transform
property:global-digits
: Use the respective glyph of U+0030…9 (0
…9
) for anyNd
character with an integer Numeric Value of 0, …, 9. Note thatfont-variant-numeric
will have an effect on those.local-digits
: The inverse transformation, using the default digits of the native script derived from the language as returned by:lang()
. This should also convert digits from other scripts, not just the international “ASCII” ones.The former could be done with #3132, but the latter couldn’t.
Vulgar fractions, roman numerals etc. would be unaffected by these transformations.
Nd
Rangesx in [0…9], y in [6…F]
The text was updated successfully, but these errors were encountered: