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

Allow text decoration for headings #811

Closed
r0ckarong opened this issue May 11, 2017 · 8 comments
Closed

Allow text decoration for headings #811

r0ckarong opened this issue May 11, 2017 · 8 comments
Assignees
Milestone

Comments

@r0ckarong
Copy link
Contributor

Is there some way to enable text decoration (specifically underline) for headings?

If not could support be added in the future? Underlined headings are a very typical things in many types of documents. It kind of limits my ability to design the document after our corporate style.

@mojavelinux
Copy link
Member

Would it be enough to be able to set a border, or does it need to be an underline?

The reason I ask is because I'm trying as much as possible to map to the constructs of CSS. So I'm just thinking about what we'd use in CSS to accomplish this styling.

Aside from that detail, I support the idea. We definitely want to allow you to match your branding requirements. That's the main idea of the theme system.

@r0ckarong
Copy link
Contributor Author

r0ckarong commented May 11, 2017

A border creates and undesirable "break" in the visual flow of the document. I do not want to have a third level heading cut the document "apart". An underline is a text accent that works well to give a visual cue that this is a new topic or whatever your functional design asks for.

What I am thinking about would be something like:

headings:
  h2_text_decoration: underline
  h2_text_decoration_color: #000000

This answer is more for #812.
https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-color

No idea which version of CSS the prawn toolchain supports at the moment.

@mojavelinux
Copy link
Member

Cool! I didn't realize the extended styles for text-decoration got accepted. That's great news.

No idea which version of CSS the prawn toolchain supports at the moment.

Prawn doesn't support CSS at all. We're just designing a theming system (which is entirely an Asciidoctor PDF construct) to encompass the spirit / terminology of CSS so it feels familiar to designers and web developers. The only thing that CSS provides us is the terminology.

@mojavelinux
Copy link
Member

Thanks for the clarification about your needs for border vs text decoration. It's clear to me that we'll need to provide both options, so I'll keep this as a discrete issue.

@mojavelinux mojavelinux added this to the v1.5.0.alpha.16 milestone May 11, 2017
@mojavelinux mojavelinux self-assigned this May 11, 2017
@r0ckarong
Copy link
Contributor Author

I actually just realized that I misread your initial question. I read "border" as basically a horizontal rule. Not what I meant at all. Whatever is easier to implement I would be happy with a border. The difference to me is that a border is somewhat detached from the text whereas the underline with some glyphs runs "through" the text and therefore is more easily identified as an underline and not a style of the block the text sits in. It probably won't make a difference to must users. I would prefer underline.

Having the other options available would be cool too. Having borders around certain elements defined in the theme.yaml would be amazing. I could add borders around filenames or paths.

Then I start thinking about all the ::before use cases ;)

@mojavelinux
Copy link
Member

The other big difference of a border vs an underline is that the border extends to the width of the content area whereas the underline only extends to the end of the text.

Drawing borders around arbitrary elements is hard at the moment, but I'm working on finding a way to make it possible. With Prawn, we literally have to draw everything you see...so it's a lot of work to do what we're used to getting from CSS "for free".

@r0ckarong
Copy link
Contributor Author

Sounds like a good argument for underline to me ^^

@mojavelinux
Copy link
Member

I realized that text decoration and border are two separate concerns. We can add support for text decoration and then address the border separately. It looks like the framework is already in place, so this shouldn't be terribly difficult to add.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Nov 18, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Nov 18, 2019
@mojavelinux mojavelinux modified the milestones: v1.5.0, v1.5.0.beta.8 Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants