CSS 3 :not() selector

Are you missing a feature? Request its implementation here.
patrick
Posts: 96
Joined: Mon May 09, 2011 11:54 am

CSS 3 :not() selector

Post by patrick »

Hi,

I want to set a content with css if the counter attribute of the parent part element is not equal to 'no', but neither the not() selector nor anything else worked:

part:not([counter = "no"]) > title:before
part:not([counter != "no"]) > title:before

Thanks,
Patrick
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS 3 :not() selector

Post by Radu »

Hi Patrick,

There are no CSS selectors to match elements with certain attributes which are not equal to a value.

But you could use a trick.
For example if you have selectors like:

Code: Select all


part[counter]:before{
content: "counter without not";
}
part[counter="not"]:before{
content: "counter with not";
}
The second selector is more powerful than the first (more specific) so all counter attributes with "not" value will be matched by it. The first selector will be matched by all elements having a "counter" attribute but the content value will be overwritten by the second selector for counter="not".

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
patrick
Posts: 96
Joined: Mon May 09, 2011 11:54 am

Re: CSS 3 :not() selector

Post by patrick »

Thanks for the workaround.

But can you implement the not-pseudo-class in the next version? It seems to be in the css3 standard, see http://www.w3.org/wiki/CSS3/Selectors/p ... asses/:not

Thanks,
Patrick
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS 3 :not() selector

Post by Radu »

Hi Patrick,

For now the Author page in Oxygen only supports CSS 2 selectors.
I added an improvement request to support as many as possible new CSS 3 selectors and this post will be updated with details when the improvement is done. But most probably not in the next version, possibly next year.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
patrick
Posts: 96
Joined: Mon May 09, 2011 11:54 am

Re: CSS 3 :not() selector

Post by patrick »

Thanks for your reply!
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS 3 :not() selector

Post by Radu »

Hi Patrick,

In oxygen 15.2 which was just released we added support for quite a lot of additional CSS selectors, including the not() selector:

http://www.oxygenxml.com/whatisnew15.2. ... SS_Support

Blog post about this:

http://blog.oxygenxml.com/2014/01/oxyge ... r-css.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply