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

flex justification of headings applied too aggressively in stylesheet #54

Open
jtauber opened this issue Dec 6, 2017 · 2 comments
Open

Comments

@jtauber
Copy link
Member

jtauber commented Dec 6, 2017

_body.scss includes:

// Right align links inside a header
h1, h2, h3, h4 {
  display: flex;
  justify-content: space-between;
  a {
      margin-top: auto;
      @extend .btn;
      @extend .btn-sm;
  }
}

Unfortunately, this doesn't just right align link inside a header but forces all children of an h* to be justified (e.g. <h1><span>A</span> <span>B</span></h1>)

I don't think we can assume this should be the default case for all h* so I think we just have to live with this being triggered by a specific class on the h*.

@jtauber
Copy link
Member Author

jtauber commented Dec 6, 2017

workaround for now is just commenting out the rule in _body.scss in your project.

@paltman
Copy link
Member

paltman commented Dec 6, 2017

I think:

<h1 class="dm-flex justify-content-between">
    Title
    <a class="mt-auto btn btn-sm">Your Link</a>
</h1>

Will work if you want to have this style work with the extra markup.


Another solution is create a new class:

.action-title {
  display: flex;
  justify-content: space-between;
  > * {
      margin-top: auto;
  }
}

so that you can do:

<h1 class="action-title">
    Title
    <a class="btn btn-sm">Your Link</a>
</h1>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants