0

I'm trying to use https://github.com/Idered/cssParentSelector with less. I'm wondering if there's a way to have less ignore a few lines and just add them as is to a css file.

body! > .modal-trigger:checked { overflow: hidden; } presents a ParseError: Unrecognised input error.

If you put body! > .modal-trigger:checked { overflow: hidden; } in a css file it works as expected.

0

1 Answer 1

1

Instead of ignoring the whole line (which would require too cryptic tricks) you can ignore just the invalid character, e.g.:

@excl: !;
body@{excl} > .modal-trigger:checked {overflow: hidden}

Alternatively you can move all that non-CSS into a separate CSS file and include it with (inline) option so Less will just copy its contents w/o parsing:

@import (inline) "whatever.css";

Another alternative would be to use CSS escaping but only if it is supported by the polyfill as well:

body\! > .modal-trigger:checked {overflow: hidden}
Sign up to request clarification or add additional context in comments.

1 Comment

You my friend are amazing. Thank you so much. P.S. Thanks for including 3 different ways, you're awesome.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.