W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

[csswg-drafts] [css-lists] Consider new value for counter-reset (#5402)

From: Leonardo Couto Chueri via GitHub <sysbot+gh@w3.org>
Date: Wed, 05 Aug 2020 17:12:26 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-673711369-1596647544-sysbot+gh@w3.org>
lcchueri has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-lists] Consider new value for counter-reset ==
Use case: To help solve issues #[3746](https://github.com/w3c/csswg-drafts/issues/3746) and #[5389](https://github.com/w3c/csswg-drafts/issues/5389) , which both needs counting sublevels of sub/super scripts for MATHML.

To use as many generic CSS properties for MathML as possible, I propose to use the list counters in a more generic way:

Considering also, from issue #[1026](https://github.com/w3c/csswg-drafts/issues/1026), _enabling the use of counter() inside calc()_  for property font-size, these counter may be used to control font-size and other styles.


Proposition A:
Consider **<counter-name> parent** as new value for **counter-reset**
**<counter-name> parent** value removes the innermost counter that originates from a sibling or its child, instantiating a counter of given name from parent element with the parent counter value.

for example, UA style for sup/sub element would be something like

sub, sup {
counter-reset: countSubLevel parent;
counter-increment: countSubLevel +1;
font-size: calc(20px-counter(countSubLevel));
}


Proposition B:
Or, instead of new value for counter-reset, may be a new property named counter-remove, as:

property: counter-remove
value: <counter-name>+ | none
inherited: no

counter-remove removes counters names from counter set of the element that comes from siblings and their child.

It happens after New Counters are instantiated and before counter values are incremented.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5402 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 5 August 2020 17:12:27 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC