scss-lint icon indicating copy to clipboard operation
scss-lint copied to clipboard

Linter proposal: disallow display and position: absolute to be used together

Open lencioni opened this issue 9 years ago • 3 comments

Elements that have position: absolute; are taken out of the normal page flow and are treated as display: block;. So the display property is redundant and should be omitted--unless it is being used to override display: none; in which case it should be set to display: block;.

cc: @janpaul123

lencioni avatar Feb 22 '16 22:02 lencioni

Hah, sure. Seems pretty minor as this typically doesn't break anything, but yeah we could do that.

Is there a proposal yet for disallowing position: absolute unless you have position: relative/fixed in the first rule of a CSS file?

janpaul123 avatar Feb 22 '16 22:02 janpaul123

I haven't seen a proposal for that. Feel free to open an issue!

lencioni avatar Feb 22 '16 22:02 lencioni

Also yeah, this is definitely minor. My intention is to prevent people from having to comment about this in code review and to prevent unnecessary clutter from the stylesheet--both of which contribute to reviewers focusing on less important aspects of the code.

lencioni avatar Feb 22 '16 22:02 lencioni