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

Refactored and renamed grid mixins #12412

Merged
merged 1 commit into from
Feb 11, 2014

Conversation

donaldpipowitch
Copy link
Contributor

I don't know if this pull request is welcome, but I've refactored and renamed some grid mixins.

I think they are more descriptive  (e.g. .loop-grid-columns is much clearer as .make-grid in my opinion). And I also DRY'ed up the generation of screen size dependend grids (xs, sm, md, lg) with a new mixin.

@cvrebert
Copy link
Collaborator

I'm assuming that this doesn't change the generated CSS whatsoever?

@donaldpipowitch
Copy link
Contributor Author

Yes, it doesn't change the generated CSS. grunt dist only builds a slightly different source map. I wasn't sure if I should commit the source map...?

@cvrebert
Copy link
Collaborator

Nope, fine as-is.

@alexewerlof
Copy link

I've been trying to tweak the mixing and agree that some of them have really tricky names. (for example the one you mentioned is in fact using the iteration pattern in LESS to create a loop but it's not very clear to an untrained eye and takes some practice to get it. Better naming helps readability while having no negative effect on the output size.

@mdo
Copy link
Member

mdo commented Jan 30, 2014

@cvrebert Is this a backward compatible change? Renaming mixins seems iffy.

@cvrebert
Copy link
Collaborator

FWIW, these seem fairly internal to me and I believe they're undocumented.
Would only affect folks using the LESS, and any breakage would be obvious and at compile-time.

@mdo
Copy link
Member

mdo commented Jan 30, 2014

Feel that. I'm definitely open to it given how complex those mixins are to begin with.

@mdo
Copy link
Member

mdo commented Feb 9, 2014

Hmm, merging master into this and running grunt produces errors, but I don't see those same errors in just master.

Running "uglify:customize" (uglify) task
{ message: 'Unexpected token: operator (<<)',
  line: 6,
  col: 0,
  pos: 169,
  stack: 'Error\n    at new JS_Parse_Error (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:196:18)\n    at js_error (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:204:11)\n    at croak (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:663:9)\n    at token_error (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:671:9)\n    at unexpected (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:677:9)\n    at expr_atom (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:1173:9)\n    at maybe_unary (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:1334:19)\n    at expr_ops (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:1369:24)\n    at maybe_conditional (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:1374:20)\n    at maybe_assign (/Users/otto/Sites/bootstrap/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js:1398:20)' }
>> Uglifying source "docs/assets/js/vendor/less.min.js,docs/assets/js/vendor/jszip.js,docs/assets/js/vendor/uglify.min.js,docs/assets/js/vendor/blob.js,docs/assets/js/vendor/filesaver.js,docs/assets/js/raw-files.min.js,docs/assets/js/customizer.js" failed.
Warning: Uglification failed.
Unexpected token: operator (<<). 
Line 6 in docs/assets/js/vendor/less.min.js,docs/assets/js/vendor/jszip.js,docs/assets/js/vendor/uglify.min.js,docs/assets/js/vendor/blob.js,docs/assets/js/vendor/filesaver.js,docs/assets/js/raw-files.min.js,docs/assets/js/customizer.js
 Use --force to continue.

Aborted due to warnings.

@cvrebert
Copy link
Collaborator

cvrebert commented Feb 9, 2014

Also, that's a JS minification error, but this PR only changes the Less/CSS.

@mdo
Copy link
Member

mdo commented Feb 11, 2014

Yeah, super strange. I only see it with this PR—just tried again today.

@mdo mdo modified the milestones: v3.2.0, v3.1.1 Feb 11, 2014
@cvrebert
Copy link
Collaborator

@mdo I can't repro. Builds fine locally. Try nuking node_modules?

@mdo
Copy link
Member

mdo commented Feb 11, 2014

Okay, so the problem was there was a merge conflict in the raw-files.min.js. To resolve it, I added docs/assets/js/raw-files.min.js to the grunt clean. Only then was I able to run grunt dist without errors.

@mdo mdo modified the milestones: v3.1.1, v3.2.0 Feb 11, 2014
@mdo mdo merged commit 7037c6f into twbs:master Feb 11, 2014
@mdo mdo mentioned this pull request Feb 11, 2014
1 task
@donaldpipowitch
Copy link
Contributor Author

Weird problem with JS minification, but I'm happy it could be fixed.

@donaldpipowitch donaldpipowitch deleted the refactored-grid-mixins branch February 12, 2014 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants