Property isolation #116

Open
ai opened this Issue Jan 24, 2016 · 14 comments

Projects

None yet

4 participants

@ai
Member
ai commented Jan 24, 2016

Why we didn’t use postcss-autoreset to have isolated styles?

@ai
Member
ai commented Jan 24, 2016

/cc @mxstbr

@MoOx
Member
MoOx commented Jan 24, 2016

My only concern with this: does this create like TONS of styles properties?
With CSS modules, I don't feel the need to use this plugin.

@ai
Member
ai commented Jan 24, 2016

@MoOx

With CSS modules, I don't feel the need to use this plugin.

CSS Modules and autoreset solves different tasks. Global CSS is not only about global selectors namespace. We still have global inteference between components.

For example, if we have a components: <List><Item></List> and in some point we put line-height: 0 to List it will collapse the text inside Item too.

@MoOx
Member
MoOx commented Jan 24, 2016

Yeah, but that's the purpose of the C in CSS right?
Seems like a bit brutal :)

@ai
Member
ai commented Jan 24, 2016

@MoOx

does this create like TONS of styles properties?

It can create a one rule with all selectors if we will process a bundle through this plugin. Like:

A, B, C {
    all: initial;
}
@ai
Member
ai commented Jan 24, 2016

@MoOx

Yeah, but that's the purpose of the C in CSS right?

Cascading should be explicit like:

.item {
    font-size: inherit;
}

inherit value still works.

Seems like a bit brutal :)

Many people told same about CSS Modules too ;).

@MoOx
Member
MoOx commented Jan 24, 2016

So if you have 150 selectors, the output is probably fun to see :)

@marcustisater
Member

Yeah, that's my only concern regarding this. The output 😅 Wouldn't that be huge?

@ai
Member
ai commented Jan 25, 2016

@marcustisater same as normalize.css. Plain CSS rules never is a problem for size. Anyway inline images will be the biggest thing.

@marcustisater
Member

I hear you, I'll leave this up for you experts to decide.

@mxstbr any input?

@mxstbr
Member
mxstbr commented Jan 25, 2016

I think it'd be nice to use it, I've never worked with it but it sounds logical in combination with CSS Modules.

@marcustisater
Member

Alright, let's try it out. I'm up for it.

@marcustisater marcustisater added PR welcome and removed question labels Jan 27, 2016
@MoOx
Member
MoOx commented Jan 27, 2016

I warn out, since we don't have a single CSS, output will be VERY redundant. Not a good idea imo.

@marcustisater
Member

I agree with you but let's try it out before excluding anything in advanced here

@marcustisater marcustisater added this to the Backlog milestone Mar 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment