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

#356 - new lint rule to disallow .col-*-12 classes alone #368

Closed
wants to merge 2 commits into from
Closed

#356 - new lint rule to disallow .col-*-12 classes alone #368

wants to merge 2 commits into from

Conversation

ChrisMBarr
Copy link
Contributor

@ChrisMBarr ChrisMBarr commented Mar 21, 2016

Fixes #356

@ChrisMBarr
Copy link
Contributor Author

This has been sitting here for a few months now. Any chance of getting this merged in?

@XhmikosR
Copy link
Member

@ChrisMBarr: can you please rebase against latest master and fix any lint errors?

@XhmikosR XhmikosR modified the milestone: v1.0.0 Aug 10, 2017
@ChrisMBarr
Copy link
Contributor Author

@XhmikosR ok, done.

@XhmikosR
Copy link
Member

@ChrisMBarr: thanks. I'll need the Wiki stuff like you did #315 (comment)

@XhmikosR
Copy link
Member

Also, note, a merge is not a rebase. If it causes any issues you will need to rebase.

@ChrisMBarr
Copy link
Contributor Author

ChrisMBarr commented Aug 11, 2017

Oops, sorry - in my normal git workflow we never use rebase.

Here are the docs to add for this rule:


W018

.col-*-12 classes used alone are not useful.

The contained elements do not need to be in a row/column at all since it will render the same way without using the grid in the first place. Using a combination of grid classes that includes a .col-*-12 is ok.

Wrong:

<div class="row">
    <div class="col-md-12">
        <p>Content here</p>
    </div>
</div>

Right:

<p>Content here</p>

Another example:

<div class="row">
    <div class="col-sm-6 col-md-12">
        <p>This is fine since it also uses other grid sizes</p>
    </div>
</div>

@XhmikosR
Copy link
Member

You have used W018 in the code.

@XhmikosR
Copy link
Member

@ChrisMBarr: this needs another fetch and rebase.

About the Wiki stuff you pasted above, is only the identifier wrong?

@XhmikosR
Copy link
Member

@ChrisMBarr: this isn't right. My patches shouldn't be here.

@ChrisMBarr
Copy link
Contributor Author

Oops, you're right. Corrected the ID. Yes that was the only thing wrong with the docs.

I tried a rebase... sorry it's new to me, I'm thinking I did it wrong. Would you prefer that I just close this and make a fresh PR, or merge master into this branch again?

@XhmikosR
Copy link
Member

I will, rebase your branch but honestly it's just too easy and you will need to learn to do it for your other PRs because they will conflict as we merge...

@XhmikosR
Copy link
Member

@ChrisMBarr: please go through all your PRs and this one and enable Allow edits from maintainers.

@ChrisMBarr
Copy link
Contributor Author

Ok done. Sorry for all the trouble here

@XhmikosR
Copy link
Member

No worries. It's just it would save me a lot of time in the future if you properly rebased and fixed any build failures instead of me doing it.

@XhmikosR
Copy link
Member

We get an error in BS v3 docs linting. I'll need to take care of that and then merge this.

@XhmikosR
Copy link
Member

XhmikosR commented Aug 11, 2017

@mdo: can you chime in for this change? For example for the BS v3 docs we get

bootstrap/_gh_pages/browser-bugs/index.html:109:9 W018 `.col-*-12` classes used alone are not useful. This element does not need to be in a row/column since it will render the same way without using the grid here at all

This is how I went to solve this for our docs twbs/bootstrap@v3-dev...v3-dev-xmr-col-12-fw

@ChrisMBarr ChrisMBarr closed this Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants