Allow to disable conditionally #604
Replies: 3 comments
-
I've attempted to solve this problem like so: @use "@picocss/pico/scss/pico" with (
$parent-selector: "*:not(#no_pico_inside_this_element *) ",
); This helps but isn't foolproof and feels hacky. I think it might work better if #533 gets resolved. |
Beta Was this translation helpful? Give feedback.
-
Not yet available in Firefox, but the @scope feature could be useful. |
Beta Was this translation helpful? Give feedback.
-
I did a small test with @scope on Chrome:
@charset "UTF-8";
@scope (.picon) to (.picoff) {
/* the base content of pico.css with all :root replaced by :scope*/
} And voilà 🎉 You can aslo re-enable pico inside a disabled block: <div class="picon">
this is pico
<div class="picoff">
this is not pico
<div class="picon">
this is pico again
</div>
</div>
</div>
|
Beta Was this translation helpful? Give feedback.
-
Hi,
The conditional version is nice, but it does not solve one of the common problem: using a third-party tool inside a pico component. For example, displaying a GoogleMap inside a card or using agGrid inside a section.
Having a
.no-pico
(or.picoff
) class that would stop the pico styles on the element and all its children would be very useful.Personally, I would like to push PicoCSS for some of the internal apps where I work, but smoothly integrating with other libraries is a must.
(Maybe there is a simpler solution to this problem ?)
Beta Was this translation helpful? Give feedback.
All reactions