This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ideas:content-formatting [2008/01/14 13:54] – Added one example itpastorn | ideas:content-formatting [2014/12/09 15:48] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 51: | Line 51: | ||
Should be displayed as '' | Should be displayed as '' | ||
+ | |||
==== New CSS rules ==== | ==== New CSS rules ==== | ||
- | **@decimal-format** that draws its ideas from xsl: | + | === @decimal-format |
+ | |||
+ | This rule draws its ideas from xsl: | ||
+ | |||
+ | It is used to specify the same things as its XSL counterpart, | ||
+ | |||
+ | === number-format === | ||
- | **number-format** | + | This rule draws its ideas from xsl: |
+ | It consists of two parts for its value. A string that is identical to the second argument in XSL number format, and an | ||
+ | optional reference to a decimal format, specified with an " | ||
==== Example CSS ==== | ==== Example CSS ==== | ||
Line 70: | Line 79: | ||
grouping-separator: | grouping-separator: | ||
decimal-separator : "," | decimal-separator : "," | ||
+ | } | ||
+ | @decimal-format creditcard { | ||
+ | grouping-separator: | ||
} | } | ||
@media all { | @media all { | ||
Line 86: | Line 98: | ||
td.sweprice { | td.sweprice { | ||
number-format: | number-format: | ||
+ | } | ||
+ | .creditcard { | ||
+ | number-format: | ||
} | } | ||
td.sweprice:: | td.sweprice:: | ||
Line 95: | Line 110: | ||
Grouping both unnecessary and unwanted, words like | Grouping both unnecessary and unwanted, words like | ||
" | " | ||
+ | Those words should only be spelled out by a screen reader when | ||
+ | | ||
*/ | */ | ||
td.price { | td.price { | ||
Line 107: | Line 124: | ||
td.sweprice:: | td.sweprice:: | ||
content: " Swedish crowns"; | content: " Swedish crowns"; | ||
+ | } | ||
+ | .creditcard { | ||
+ | /* Speak numbers in pairs, no nead to hear the word " | ||
+ | number-format: | ||
} | } | ||
} | } | ||
+ | |||
+ | |||
+ | ==== Parsing ==== | ||
+ | |||
+ | When an UA sees that an element has a number format rule, it should try to convert that elements textcontent to a number. | ||
+ | |||
+ | If such a conversion is not possible, the CSS rule should be ignored. This rules is **primarily** intended for table cells, short headings, simple inline elements such as span, some form elements and perhaps a new number element. | ||
==== Remarks ==== | ==== Remarks ==== |