Skip to content

Refactoring grid implementation. - #14410

Closed
seven-phases-max wants to merge 1 commit into
twbs:masterfrom
seven-phases-max:refactoring-grid-framework
Closed

seven-phases-max wants to merge 1 commit into
twbs:masterfrom
seven-phases-max:refactoring-grid-framework

Conversation

@seven-phases-max

Copy link
Copy Markdown

This is a "preview" PR for discussion and feedback. Since there're several possible methods each with its own pros and cons I had to write a small (pseudo)-blog-post about this. Please read.


(Updated) This PR implements Method #1. The generated CSS should be equal to what it is now, except 5 added dummy classes (.col-any-any, .col-xs-any, .col-sm-any, .col-md-any, .col-lg-any) plus the generated grid classes are (intentionally) reordered. (Note also that all mixins are rewritten and reordered so the diff view does not make any sense).


A few questions. I'm not sure if "coding guidelines" questions (specifically "What Less features may we use?") are appropriate here but since this directly affects the code in the PR I guess I'll ask. In particular:

  • Pattern Matching. I can see that when guards are always used even where the "Pattern-Matching" would result in more clean and less verbose code: is there any special reason behind this?
  • Temporary variables. I also was not able to find (though I could just miss) even a single temporary variable (specifically a temporary variable inside a mixin) in the sources: is there any special reason for this?

Thanks.

@cvrebert cvrebert added the css label Aug 17, 2014
@cvrebert

Copy link
Copy Markdown
Collaborator

Including the generated bootstrap.css in the PR would be useful, so we can ensure that the size/redundancy of the CSS doesn't increase significantly.

Comment thread less/mixins/grid-framework.less Outdated

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdo

mdo commented Aug 18, 2014

Copy link
Copy Markdown
Member

I'd probably prefer the first method since that doesn't lead to extend problems down the line. However, I'm probably in favor of punting this entirely for v3 since it's a major rewrite of how we do things right now and rewriting it this close to EOL for v3 doesn't make much sense to me.

Maybe for v4? But, that all depends on a lot of other things first.

@seven-phases-max

Copy link
Copy Markdown
Author

I'd probably prefer the first method

Cool. So I guess I'll commit the corresponding code (I feel it's already turned to be too confusing to advertise one method but to PR another), so that the whole thing become more consistent before it's closed.

@seven-phases-max

Copy link
Copy Markdown
Author

I'll commit the corresponding code

Done.

@mdo

mdo commented Aug 23, 2014

Copy link
Copy Markdown
Member

Per my earlier comment, I don't want to re-engineer the entire grid system in v3.x. Punting any big changes like this to v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css Sass sources or compiled CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants