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

Add helper layout class to center content #56

Merged
merged 5 commits into from
Apr 15, 2015

Conversation

thomastuts
Copy link
Contributor

This adds the .centered class which can be used either on a column, or outside of the grid. This also allows us to center content that is not placed in a grid row (for example, a fixed-width navigation, ...). This fixes issue #52.

@mdo #52 said you wanted to implement it on a column level, however, wouldn't it be better to have a .centered class like this which you can also use to center non-grid content?

This adds the `.centered` class which can be used either on a column, or
outside of the grid. This also allows us to center content that is not
placed in a grid row (for example, a fixed-width navigation, ...).
@mdo mdo added this to the v2.0.3 milestone Mar 26, 2015
@mdo
Copy link
Contributor

mdo commented Mar 26, 2015

Agreed, this is probably going to be a better approach.

@mdo
Copy link
Contributor

mdo commented Mar 28, 2015

We'll probably want to move this to _utility.scss to reiterate it's intended uses. Care to make that change and perhaps take a stab at adding a docs section for it? If not, no worries, I'll handle it :).

@thomastuts
Copy link
Contributor Author

Sounds good. Do the docs belong in the Layout or the Utilities section? My gut feeling says Layout since that's where I'd look for something like this myself.

@mdo
Copy link
Contributor

mdo commented Mar 28, 2015

I'd say it's worth putting most of the docs in the utilities section—explaining it's purpose and how the CSS works for it—and then mention you can use the utility class in our Layout section with an grid column example.

@mdo mdo modified the milestones: v2.0.3, v2.0.4 Mar 30, 2015
@mdo mdo added the css label Mar 30, 2015
@thomastuts
Copy link
Contributor Author

Took a little longer than expected, but the docs are added now. Not sure how you feel about this, though:

{% example html %}
<div class="columns">
  <div class="one-half column centered">
    .one-half
  </div>
</div>

<br />

<nav class="menu centered">
  <a class="menu-item selected" href="#">Account</a>
  <a class="menu-item" href="#">Profile</a>
  <a class="menu-item" href="#">Emails</a>
  <a class="menu-item" href="#">Notifications</a>
</nav>
{% endexample %}

Without the <br />, things would stick together vertically and look ugly. Any thoughts on this, or a potential fix?

@mdo mdo merged commit 156b829 into primer:master Apr 15, 2015
This was referenced Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants