daneden / daneden/Toast

Can't center grid columns in small/medium device-widths

Open
#53 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
2k
Forks
253
PR merge metrics
No merged PRs in 30d

Description

I want to center a `.grid__col--m-2-of-3` column. But it looks like this selector:

```css
@media (max-width: $toast-breakpoint-medium) and (min-width: $toast-breakpoint-small) {
&[class*="#{$toast-grid-column-namespace}--m-"] {
display: inline-block;
margin-right: -.24em;
}
...
}
```
is overriding the `display:block; margin-right:auto;` of `.grid__col--centered`. Hence I can't center the column.

Inspector screenshot below:

![screen shot 2017-02-01 at 10 10 15](https://cloud.githubusercontent.com/assets/16062922/22502838/ac6c12e8-e866-11e6-9c08-2bb19dfb3c00.png)

Is this a bug or am I missing something? Why is the `display:inline-block` selector necessary? Surely these declarations are by default inherited from `.grid__col` anyhow?

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the `.grid__col--centered` rule alongside the small/medium `@media` selector for `[class*="#{$toast-grid-column-namespace}--m-"]`. Reproduce the cascade in the affected device-width range and verify that a centered `.grid__col--m-2-of-3` remains centered without breaking the responsive grid alignment.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.