Hiya, I'm working to make Red Hat product documentation templates as slick as possible for web presentation.
One thing we've run into is inline CSS getting added in certain contexts that doesn't end well on small breakpoints. I'm trying to create guidance for the authors on what to avoid, but I'm having a hard time finding what AsciiDoc syntax will create inline styles. The syntax that brought this up was: [[table-variable-names-differences-between-ansible-2.1-and-2.2]] .Differences in Variable Names Between Ansible 2.1 and 2.2 [width="40%",frame="topbot",options="header"] It created something like: <table style="width: 40%"> Which does very poorly at 320px wide screens The docs didn't seem to have anything specific I could find, is there something I can search for in the AsciiDoc parsing code to find what results in inline styles? I'm not familiar with Ruby, but if I can get a lead on what to look for I'm sure I can parse the relevant parts. I'm most considered with things like width, margin, padding, border, font/background color. Anywhere AsciiDoc adds CSS classes I'm happy with, just worried about style attributes. Thanks for your time! |
Awful as it is, you may get more/better advice on the asciidoctor gitter channel.
I’m slightly surprised width turns into an inline style. I think all the other things you mention are handled in the stylesheet. I’d suggest you investigate roles; these turn into classes in the html and you can then style them in the stylesheet. David Jencks
|
Administrator
|
In reply to this post by wesruv
A width can only be translated into a CSS style since that's the only way to satisfy the request for an explicit width. What I would recommend is instructing authors to not use that attribute. As an alternative, you can give writers a list of predefined roles, which then translate into CSS classes. For example, instead of width=40%, it would be "width-half" or "width-narrow". That would look like this: .Differences in Variable Names Between Ansible 2.1 and 2.2 [%header.width-half, frame=topbot] You can find out what settings generate inline CSS by studying the converter. See https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor/converter/html5.rb It's rare, but it mostly has to do with setting column widths for tables. Best Regards, -Dan On Wed, Sep 2, 2020 at 10:09 AM wesruv [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hiya, I'm working to make Red Hat product documentation templates as slick as possible for web presentation. -- Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux |
Administrator
|
In reply to this post by David Jencks
> I’m slightly surprised width turns into an inline style. How else would you honor a request for user-defined width? As far as I can see, there's no other way. Best Regards, -Dan On Wed, Sep 2, 2020 at 10:35 AM David Jencks [via Asciidoctor :: Discussion] <[hidden email]> wrote: Awful as it is, you may get more/better advice on the asciidoctor gitter channel. -- Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux |
Indeed…. I reserve the right to be surprised at completely obvious and sensible things :-)
David
|
Free forum by Nabble | Edit this page |