Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Scoping CSS to showcase styled components

Started by Tim Briscoe 9 years ago · 2 replies · 885 views
9 years ago

I am building a style guide using Grav. I'd like to show examples of styled components by referencing an external stylesheet—but without override the Grav's own styles. Something like:

Here is an example of preferred table styling:

(Show html code)

(Show styled example using above html combined with external css)

In other words, the scope of the style would be limited to the component examples. I initially thought iframes for each example was the way to go. That's probably untenable.

Can anyone think of a better way to build this concept?

9 years ago

Don't think its possible without the iframe, only if you add maybe a custom class infront of the external css and then you call it here that could work?

9 years ago

Thank you for the response. I do think a custom class is the way to go.

Suggested topics

Topic Participants Replies Views Activity
Support · by Anna, 4 days ago
1 96 4 days ago
Support · by Anna, 3 weeks ago
1 265 3 weeks ago
Support · by webmasterodp, 1 month ago
4 380 1 month ago
Support · by nwhitfield, 1 month ago
2 351 1 month ago
Support · by stell, 2 months ago
5 657 1 month ago