Conversation
|
||
width: calc(#{$_column-width-calc}); | ||
} | ||
@else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@else should be placed on same line as previous curly brace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@else should be placed on same line as previous curly brace
Has there been more discussion around namespacing? I liked the |
Nice! This feels like a really great start… I really enjoy the fact that instead of creating a special syntax, or term, you can create a gutter-less grid with |
/// | ||
/// @type map | ||
|
||
$neat-grid-default: () !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this feels too similar to the one above, $neat-default-grid
, which I think could easily lead to confusion or accidental bugs.
Maybe this one becomes $neat-base-grid
? Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh whops, I think I missed a copy-paste. I took that from Bourbon. Perhaps I don't need that +$neat-grid-default: () !default;
? Now that I look at it, I don't think it's useful here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see what you mean now, in relation to the later comment. So I'm going to remove it, and trying to convey to the user that they should define this ahead of time, if they don't want these default values
We’ll need to have a merging function of sorts, so to allow the user to define their overrides in a map, and those get merged in. Currently, I don’t think this works… |
@tysongach Can you explain the need for the merging functionality? I was trying to avoid the need to merge maps by not using the same variable. This is done in a way that asks the developer to provide a grid context to the method call, as opposed to overriding an assumed global map variable. The methods use the base grid as fallback only. So it's either "use the default" or "provide your custom grid." Wat do u think? |
@joshuaogle regarding naming prefix, I am down for both! What do y'all think? We have had some issues, and anecdotal evidence that overly-generic variable names have conflicted with other frameworks and custom variables. I have not seen anyone using
|
@wardpenney @joshuaogle Sass 4 is expected to introduce a native module system, and part of that system will (likely) allow us to associate prefixes dynamically, as well as allowing users to change/swap the prefix dynamically to their pleasing. It sounds incredible and you can read more about that here: https://github.com/sass/proposal.module-system#using-modules |
So happy to see this. Pumped for some new functionality. I agree with @joshuaogle that personally I prefer But it's not a huge issue for me. ¯_(ツ)_/¯ I would like to take a deeper look at this PR over all. lets hold off merging till at least Friday. |
I've done my best to completely tear this apart and find any use-case that I've come across that has made Neat frustrating to see how these changes hold up. I love it. Not only is the code so so much simpler than the current mixins, but the way you've set it up to handle multiple grids is really clever. I love the idea of setting up multiple grids (in Code looks great and this is nice solid foundation in my opinion 👍 Good work @wardpenney and @whmii! @tysongach I hadn't seen the module system in Sass4, and it looks like the perfect solution to the naming problem (and I think a good reason to use |
@wardpenney Hey I have a weird request. Would you mind rebasing your neat pr off of https://github.com/thoughtbot/neat/tree/neat-2.0.0-origin It is just the addition of the grid columns mixin. I put a lot of work in to that system, and wanted to have my signature on it. Not because of the code itself but I feel like that file represents the idea as a whole. I thought it wouldn't bother me, but annoyingly it does. This is very petty. I apologize. 🙇 Also, based on some of the comments, I swapped out the |
045ec39
to
49650f1
Compare
&::after { | ||
clear: both; | ||
content: ""; | ||
display: table; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be display block, Display table is no longer needed → thoughtbot/bourbon@7633f70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1…don’t forget to also update Line 19 above, for the docs showing output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call!
BTW, I like the inclusion of grid-container, instead of grid row. I think grid-row is a leftover from when people were wrapping each row of content individually, which is very rare now a days. |
@@ -0,0 +1,35 @@ | |||
/// Creates Neat grid container with clearfix. | |||
/// | |||
/// @argument {list} $grid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% on sass doc but I think this line should be:
/// @argument {map} $grid [$neat-default-grid]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@whmii @wardpenney I’m confused why we rebased off of another branch and are now merging changes from that branch into If we go back to the original commit this PR was opened with, get it reviewed and merged, we can then put up a new PR with other additions (a2c5842). This way it gets a solid review, discussion and clear path in. Will you’re commit authorship will remain the same. |
/// | ||
/// @type map | ||
/// | ||
/// @property {number (unitless)} columns 12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property’s default value should be in brackets:
- /// @property {number (unitless)} columns 12
+ /// @property {number (unitless)} columns [12]
I’m going to rebase and remove Will’s commit, which is the same commit in his new PR: #415 |
df602fd
to
4e258aa
Compare
I removed 65980d3 and this PR is now solely Ward’s addition of |
|
||
@mixin grid-container($grid: $neat-default-grid) { | ||
margin-left: auto; | ||
margin-right: auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should “centering” be an option? Do we need it at all? Maybe this mixin is literally just a wrapper to a clearfix mixin, so to have a nice grid API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we had chatted a bit about that earlier and defaulted to this. But maybe the best thing to do is not try to do anything, and let the developer do it.
Other option is to handle it in the $grid
map definition, center
, left
, or right
but that seems like a lot of logic for little benefit. Also, on more than one project we wanted it left aligned at large breakpoints, and centered at lower ones. The $grid
setting route would prove painful for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. let's remove the option and just have this be a simple mixin with no options (since we aren't using $grid
anyways).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this grid-container
will literally just be a wrapper for a clearfix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 💩. I would imagine anyone using a floated grid would want this, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the margin
styles may do more harm than good. I'm okay with it just being a clearfix wrapper. It's really all we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wardpenney Yeah. To clarify, I think it's totally fine for this mixin to just be a clearfix. It makes for a good API for the grid system and prevents us from having to say “Oh, don't forget when you use grid columns, that you need to use a clearfix!”.
👍
#415 has been merged |
4e258aa
to
13d4e29
Compare
<div class="box column--thirds"> | ||
</div> | ||
<div class="box column--thirds"> | ||
</div> | ||
</main> | ||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file is oddly indented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pre
tag will add indentation as whitespace in the code block that you can see. It looks weird here, but you have to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshuaogle That pre
tag is deleted. I’m referencing the fact that the entire HTML document is indented with two spaces: https://github.com/thoughtbot/neat/blob/neat-2.0.0-basic-grid/contrib/index.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay. Your comment was showing up on the deleted side so I thought you were just curious. Yep, good catch on that spacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh weird, good catch.
b16573b
to
e7005de
Compare
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<header class="welcome-message" role="banner"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove all these unused classes?
✂️ welcome-message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
e7005de
to
98d681a
Compare
@include grid-column(1, $nested-grid); | ||
} | ||
|
||
.grid__column--full { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector grid__column--full
should be written in lowercase with hyphens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector grid__column--full
should be written in lowercase with hyphens
98d681a
to
12d8246
Compare
@@ -0,0 +1,4 @@ | |||
$nested-grid: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not put this in _variables.scss
, since $nested-grid
is just a variable?
12d8246
to
730c16b
Compare
@include grid-column(4); | ||
} | ||
|
||
.grid__column--full { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector grid__column--full
should be written in lowercase with hyphens
👍 Do it. |
730c16b
to
624ea49
Compare
* Add to contrib
624ea49
to
f589a7f
Compare
Builds on @whmii's Cask grid and previous PR #406. The goal is to do set up a few features:
gutter: 0
grid type)I still need to write tests and possibly factor the column width calculation into two discrete
@functions
.LMKWYT!