CSS namespace / scope definition

I want to apply the rules in the CSS file to a specific div / class, therefore, for example, the contents of events.css applies only to the contents of the class named .events and not outside this area without the need to add the .events class to the beginning of each CSS rule.

I think this is impossible, but you never know.

If not, I'm thinking of achieving the same effect, prefixing .events to CSS rules after they have been loaded / edited. I think this should be pretty hopeless, but does anyone see any problems?

+3
source share
5 answers

I think this is not possible though

. iframe. -.

, .events CSS , /. , , - - ?

? CSS, , .

, , :

/* This is my grate CSS
.sausage { color: red; } adds a class rule
/*/ .eggs, .bacon { color: red; }
.potato:before { content: "; }
.beans { content: "; }

- CSS. .eggs, .bacon .potato .events. .sausage .beans .

+1

, , . CSS , / . , - - ?

.

+1

".event" CSS. , , , , , .

+1

, - .events.

, , .events , . , .events.special .aboutus.special, .

, , . ( gzip , .)

0

'.events' . , . CSS.

, , , .

0

Source: https://habr.com/ru/post/1717817/


All Articles