Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box model rule alerts when width or height are set to auto #287

Closed
menzer opened this issue Jun 14, 2012 · 3 comments
Closed

Box model rule alerts when width or height are set to auto #287

menzer opened this issue Jun 14, 2012 · 3 comments
Labels
Milestone

Comments

@menzer
Copy link

menzer commented Jun 14, 2012

The purpose of the box model rule is to alert the author to potentially unforeseen sizes due to the box model when width or height declarations are combined with other box-model declarations. But if the width or height declaration is overriding a set value and returning to auto, in an OOCSS extension for example, then a padding or border declaration should not trigger the box alert rule, as there is explicitly no expected height or width on the element.

@mahonnaise
Copy link
Contributor

.foo {
  padding: 5px;
  width: auto;
}

This does indeed trigger a warning. I agree that it shouldn't. It actually shouldn't trigger a warning whenever the value isn't a <length/percentage>. [There are a bunch of other possible values].

[Side note: I recommend to disable this rule, because it's actually not very helpful. It's supposed to detect a glaringly obvious defect, which hits you right in the face when you produce it. When it doesn't tell you something you've already noticed yourself a few minutes ago, it will just waste your time with false positives. I.e. you did the math and you get indeed the results you were after.]

@nzakas
Copy link
Contributor

nzakas commented Jun 15, 2012

Makes sense. So basically, it should warn only when width or height is a <length> or <percentage> and otherwise not.

@mahonnaise
Copy link
Contributor

"Don't use width or height when using padding or border."

Will need some rephrasing, too.

@nzakas nzakas closed this as completed in e025e5a Jul 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants