Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Falsely detecting empty spacer columns #358

Open
stephtr opened this issue Feb 27, 2016 · 9 comments
Open

Falsely detecting empty spacer columns #358

stephtr opened this issue Feb 27, 2016 · 9 comments
Labels

Comments

@stephtr
Copy link

stephtr commented Feb 27, 2016

Empty columns can be used for styling, like <div class="col-xs-1 col"></div> with col defining a border or background-color. In this case W009's are detected even though the "empty" column can't be replaced.

@cvrebert cvrebert added the bug label Feb 27, 2016
@cvrebert
Copy link
Collaborator

Seems like you should typically be able to accomplish the same thing without spacer columns by moving some styles from the column to the row. What's your real-world example where spacer columns seem necessary?

Also, W009 is a Warning rather than an Error precisely because it may have false-positives.

@stephtr
Copy link
Author

stephtr commented Feb 27, 2016

For example http://codepen.io/stephtr/full/grOmQe/
A real-world example would be if you include colored blocks into something like http://itsashapechristmas.co.uk/.

I reported it mainly because the twbs-lmvtfy bot treats these warnings as errors, but this is intentionally (cvrebert/lmvtfy#91).

@cvrebert
Copy link
Collaborator

@stephtr The links in your comment are broken. Markdown links can be written as either just the raw URL, or as [link text](http://your.url.goes/here/)

@cvrebert
Copy link
Collaborator

X-Ref: twbs/bootstrap#11130

@stephtr
Copy link
Author

stephtr commented Feb 27, 2016

I corrected the links (http://codepen.io/stephtr/full/grOmQe/ and http://itsashapechristmas.co.uk/ ).

@cvrebert
Copy link
Collaborator

http://itsashapechristmas.co.uk/

I'm not getting any W009 errors on that page:
shape_xmas

@stephtr
Copy link
Author

stephtr commented Feb 27, 2016

That website does not even use Bootstrap (it was intended to show where empty columns could be useful). I meant if someone would build a website like that with Bootstrap and insert colored spaces then there would be a W009.

My suggestion would be to check not only if there are col-..-.. classes mentioned in the html code and if the element has no content but also if there are no custom classes (or classes other than col-..-..) mentioned.
For example <div class="col-xs-6 col-md-1"></div> would be a W009 rather sure, but something like <div class="col-xs-1 red-square"></div> is propably a false-positive.

@cvrebert
Copy link
Collaborator

probably a false-positive.

Eh, it's an imperfect heuristic either way. What if we just tweaked the warning message text to clarify that it's uncertain?
As for the bot, I reopened cvrebert/lmvtfy#91

@stephtr
Copy link
Author

stephtr commented Feb 27, 2016

Another option would be to ignore that border case and leave the warning message as it is (there probably are much more true-positives than false-positives).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants