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

Slide class should override global class #503

Closed
georgjaehnig opened this issue Jan 22, 2018 · 3 comments
Closed

Slide class should override global class #503

georgjaehnig opened this issue Jan 22, 2018 · 3 comments

Comments

@georgjaehnig
Copy link

Hi, using this code

class: center
layout: true
---
# Standard slide
---
class: left
# Left aligned slide

I'd expect Left aligned slide to be left-aligned. However, it is centered. Is this a bug or is there a reason for it?

@mschilli87
Copy link
Contributor

@georgjaehnig: try

class: center
layout: true
---
# Standard slide
---
class: left
layout: false
# Left aligned slide

Without de-activating layout you effectively set class twice for the slide.

I agree however that intuitively I would expect the left setting to have override the center.

@georgjaehnig
Copy link
Author

georgjaehnig commented Jan 23, 2018

Thanks. layout: false does the trick for the class – but then I'm also loosing all the other layout settings, like the footer line ☹.

I also think, class: set on the slide should override the one set for the layout.

@abelards
Copy link
Collaborator

Hi all, new contributor here.

I think it's just CSS: you add more and more classes, and the most specific rule wins.

I understand that center is the same priority as left, but slightly more important.
If I were you @georgjaehnig I would have done some CSS like .center.left { text-align: left; }

I think perhaps <25% of our users will like the "override" and >75% will like that they can "add" classes and behaviours, so it's like "inheriting" more behaviour from the same class as the base layout, and adding specific stuff for the slide that deserve it.

So I think I'm going to close the ticket now, and add my trick to our knowledge base. WDYT?
https://github.com/gnab/remark/wiki/HTML-CSS-JS-samples

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