-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
New Responsive Grids: Better Defaults, and Customizations via Tooling or Web UI #267
Conversation
We'll be using [rework-pure-grids][1] to generate responsive grids on a per-app basis. This is more useful than having .pure-g-r inside Pure's `src/` since media queries cannot be over-written. [1]: https://github.com/ericf/rework-pure-grids
* Add this class to an image to make it fit within it's fluid parent wrapper while maintaining | ||
* aspect ratio. | ||
*/ | ||
.img-responsive { |
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.
Why is it not prefixed with pure
?
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.
Yeah good point, this should be. I also think we could probably drop this style. Anyone who's doing something with images in their grid can easily add these styles.
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 it's pretty important to have a fundamental class such as this in Pure. Everyone uses this technique for responsive images, so instead of people duplicating this class in their app codebase, it should be provided by Pure. I agree that it should have a pure
prefix 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.
How about: pure-img
?
👍 Yes yes yes! |
@tilomitra two other major todos before we merge this are finish the work on pure-site's Get Started page, and update the Base docs to say less about Normalize.css (we can link over to its site) and more stuff we add on top of Normalize.css. |
Cool, added that stuff to the list above. |
UpdateWe've done a bunch of work on the new Get Started page for the website; it's close to being ready to ship, here's the code branch. After revamping Pure's website to be mobile-first and fully responsive, and while building out this new Get Started page, @tilomitra and are leaning towards adding a new optional CSS module that contains some common, default breakpoints. This new module — let's call it We think this will give the greatest flexibility to Pure while not removing a main feature, responsive Grids, but instead making it much better. Of course the Get Started page will guide people on using both Default BreakpointsHere's a proposal for what the default breakpoints should be. The goal is to encourage mobile-first CSS coding, and note that all
Other possible additions to this list:
And these would be used like this: <div class="pure-g">
<div id="main" class="pure-u-1 pure-u-md-3-4 pure-u-lg-2-3">
<h1>Main Content</h1>
</div>
<div id="sidebar" class="pure-u-1 pure-u-md-1-4 pure-u-lg-1-3">
<h1>Side Content</h1>
</div>
</div> Note: In this Feedback, PleaseWe'd like your feedback on what default breakpoints you think would be most useful, and also the naming scheme used. Thanks! Also remember that we've built out tons of tooling and we have the Get Started page coming which makes customizing Pure's Grid easy and is very powerful. |
My personal feedback without trying this yet: I really love the idea that you're having default breakpoints available to be easily included for new projects. This might have always been the intention though. I love how it appears our existing markup will be compatible, but I'm yet to test exactly if this will be possible (by making the default pure-u-1 etc classes be "desktop first"). Some notes on backwards compatibility would be good? I'm not a fan of the small = sm, medium = md, large = lg. Personally, I'd have suggested s, m, l. And if you want more or it's ambiguous adding the next letter (not what appears to be a random consonance, lg looks fine but md?). But again, this can just be fixed with the tooling, we'll choose s,m,l and perhaps xl or xs (I guess it's in line with clothing sizes?). I don't know if that feedback is at all useful though. |
Yeah we'll be sure to add those notes. Also, if people want to take a desktop-first approach, they will be able to customize Grids to do that via the tools or Get Started web UI.
Yeah I thought about using the single letter names, but
Yeah it is! How do you feel about the width values? |
I completely agree with the fact <div class="pure-g">
<div id="main" class="pure-u-1 pure-medium-3-4 pure-large-2-3">
<h1>Main Content</h1>
</div>
<div id="sidebar" class="pure-u-1 pure-medium-1-4 pure-large-1-3">
<h1>Side Content</h1>
</div>
</div> As for the break points, |
I think we can go with the following breakpoints: sm: 568px (screen and (min-width: 35.5em)) We don't need the xs since the default |
@bradleyfalzon Just curious - does 1280px have a significance over 1200px? Is it a device breakpoint? |
I only suggested 1280 over 1200 because of a boundary, when I made the comment I incorrectly assumed it was 1920x1280 to target 1080p displays and larger, but I had my measures mixed up (it'd target 1280x800 displays instead). It's just all the other measures seemed to land on a common resolution, 1200 just seemed out, that's all. http://www.w3counter.com/globalstats.php?year=2014&month=1 (see bottom right table) Based on those stats, it might not be such a bad idea to go up to 1366 and call that xl. Between 1024 and 1200 is < 200px, which isn't really much space to do anything spectacular anyway. This was just thinking out loud, the tooling is a great idea, and we'll most likely generate our own breakpoints for simpler prefixes, and adjusting xl to something larger. |
@tilomitra d1ab35a e91b2be conflict with what's already done in master. I guess Also why add these commits now while we're still in discussions on the actual breakpoint values? |
@bradleyfalzon Good call on |
Just to reiterate my point to make sure it wasn't lost in my other comments, IMHO
But that's all, tooling can customise this. |
@bradleyfalzon I worry that without the |
Remove grids-nr.css and use grids-responsive.css in Forms manual test
What about generating grids with gutters with the new tooling support? |
@kwando We're not afraid to tell users of Pure that they are going to have to write some CSS. With this fundamental principle in mind, we don't want our tooling to lead to unnecessary bloat that is commonly seen when using CSS preprocessors. This is why we're not bundling the As @tilomitra points out, we have examples to show how people can write a little bit of CSS on top of what Pure provides to achieve their desired result. Let us know if there's other common grids-usage patterns that would benefit for similar examples. |
I prefer the first suggested default XL size with 1200px. for the grid I'd like to see a social/comment Layout example like facebook, twitter or this: where a user-image requires a defined space and the content uses the remaining available space. thank you |
@xlnt-webdesign We're going with 1280px, but you can easily change this with the Get Started web interface that we'll be launching for Pure for the next release. |
@tilomitra Looks good. Once all the HISTORY changes are added, let's merge this and deploy |
New Responsive Grids: Better Defaults, and Customizations via Tooling or Web UI
Sorry if this has been already asked... Is it possible (and easy) to make Pure 'desktop-first'? I've tried mobile-first before with Foundation and I didn't really like the process. I prefer the other way around. |
This pull request has the following things inside it:
.pure-g-r
..img-responsive
class tobase.css
.I've been using this branch locally to make the Pure-site mobile first, and use the new mobile-first grid system that's in the works.
Removing
.pure-g-r
This pull request removes
.pure-g-r
and it's associated media-query rules from Pure. This is due to the following:.pure-g-r
any more.Fluid Images
Since we are removing
.pure-g-r
, we need to have some way for folks to have their images be fluid. Before, this used to be defined ingrids-r.css
as this:Since that no longer exists, I added an
.img-responsive
class, which has the same rules. Add this to your images if you want them to be fluid.Things to do before merging this PR in
HISTORY.md