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

Subheadings below a heading with no paragraph content are aligned incorrectly. #1826

Closed
Flamenco opened this issue Jan 10, 2018 · 12 comments
Closed

Comments

@Flamenco
Copy link

Using the 'Open Publishing Space' starter

# Foo
## Bar 1
abc
## Bar 2
abc

When it do this, the Bar 1 heading is centered instead of left aligned.

Workaround

# Foo
<nbsp />
## Bar 1
abc
## Bar 2
abc

before

after

@paulhibbitts
Copy link

paulhibbitts commented Jan 19, 2018

Thanks for the issue @Flamenco , but please create a copy of it on the repo for the "Open Publishing Space" theme and I will take a look (I am the author of the inherited theme): https://github.com/hibbitts-design/grav-theme-antimatter-open-publishing

UPDATE: I've looked into this and it seems to be coming from the parent theme used (Antimatter) and is intentional as H1 and H2 are used as centering title elements with the theme - glad you found a workaround. You could also use a custom.css file to change the default H1 and H2 alignment if you wished.

@Flamenco
Copy link
Author

Flamenco commented Jan 19, 2018

The issue is that the h2 is centered if it has no paragraph above it, but is left justified if there is content. That does not seem correct.

@Flamenco
Copy link
Author

Flamenco commented Jan 19, 2018

And it's not just alignment... It looks like a parsing issue to me. In the first screen shot, "bar 1" and "bar 2" are both h2 and should be the same style.

@Flamenco
Copy link
Author

So the problem is the second h2.

I changed the CSS in typography.css from:

h1 + h2 {}

to

h1 ~ h2 {}

That solved it for me, but I don't know what that might break...

@paulhibbitts
Copy link

Thanks @Flamenco , I will try this in my Open Publishing Space theme too.

@paulhibbitts
Copy link

@Flamenco To confirm, what theme are you using? I do not see a typography.css file in Antimatter (or my Open Publishing Space theme).

@Flamenco
Copy link
Author

This happens on the plain ol' antimatter theme.

@Flamenco
Copy link
Author

screen shot 2018-01-19 at 3 00 12 pm

@Flamenco
Copy link
Author

antimatter/template.css

@Flamenco
Copy link
Author

I changed all the adjacent sibling selectors (+) to general siblings (~)

@paulhibbitts
Copy link

paulhibbitts commented Jan 19, 2018

Thanks @Flamenco , perhaps it might be best to open this as an issue on the Antimatter repo (https://github.com/getgrav/grav-theme-antimatter)?

In the meantime I will also see if I can address it in my inherited theme (my CSS skills are quite basic, thanks for sharing how you are trying to address the issue).

@Flamenco
Copy link
Author

getgrav/grav-theme-antimatter#127

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

3 participants