Page 1 of 1

CSS 3 :not() selector

Posted: Thu Nov 17, 2011 1:21 pm
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

Re: CSS 3 :not() selector

Posted: Thu Nov 17, 2011 1:49 pm
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

Re: CSS 3 :not() selector

Posted: Thu Nov 17, 2011 4:03 pm
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

Re: CSS 3 :not() selector

Posted: Thu Nov 17, 2011 4:19 pm
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

Re: CSS 3 :not() selector

Posted: Fri Nov 18, 2011 11:07 am
by patrick
Thanks for your reply!

Re: CSS 3 :not() selector

Posted: Mon Jan 27, 2014 2:59 pm
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