Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Scoping CSS to showcase styled components

Started by Tim Briscoe 8 years ago · 2 replies · 500 views
8 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?

8 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?

8 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 Thomas, 1 week ago
2 54 12 hours ago
Support · by Anna, 3 days ago
2 60 15 hours ago
Support · by Justin Young, 15 hours ago
1 30 15 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 57 5 days ago