Closed haochenx closed 11 months ago
@mojavelinux There should be a simple stylesheet that only contains styles for the translated AsciiDoctor elements. Just a simple stylesheet that does not introduce another grid system,...
I recently encountered a similar issue when migrating from one static website generator to another that does not override the default asciidoctor.css well for a custom theme. I suggest to separate essential structural styles from formatting styles. For example, the image position/alignment is essential for the layout but the background-color of the footer should be left to the website theme whether specified or not. Any followup idea is appreciated.
I created issue asciidoctor/asciidoctor#2541 for the general problem of no stylesheet docs.
It's not that easy to create a stylesheet that contains only styles that applies to Asciidoctor elements because for instance Asciidoctor is using ordered and unordered lists using ul
and ol
. We are also using dl
and dt
elements.
Since the default HTML5 converter is using an id
we could use child selectors to avoid conflicts: https://github.com/asciidoctor/asciidoctor/blob/426d8389aa1706a589b66c96801542f587ae6b61/lib/asciidoctor/converter/html5.rb#L184-L186
In other words, Asciidoctor styles will only be applied in the <div id="content">
.
This does not resolve the "consistency" issue though.
As suggested by @farleylai, we could separate essential structural styles from formatting styles but we need a clear definition of what is a structural style and what is a formatting style ? Is margin a structure style or a formatting style ? Text alignement is a structural style ?
position
display
left
top
bottom
right
overflow
?width
?height
?padding
?margin
?vertical-align
?Maybe it's easier to list which formatting style we do not want to apply:
background-color
background
color
font-size
font-family
? (ie. literal blocks and listing blocks will use the default font)line-height
?font-weight
?border
?I'm in agreement that the new HTML5 converter should provide a bare-bones stylesheet as well as a ready-made one. That serves the purpose of giving a designer a starting point while giving a casual user something to go with right out of the box. However, I think that should be part of the new HTML5 converter effort. This repository is being archived.
I am trying to integrate AsciiDoctor with an existing website but found that without the AsciiDoctor stylesheet some elements are ugly and difficult to style. But using a theme found in this repository changes the styling too much so that the resulting page won't fit the style of the rest of the website.
Could we have a "plain" theme that doesn't change any styling (fonts, h1..h7 styling etc.) but makes AsciiDoc specific elements (e.g. admonitions, attributions in quote blocks etc.) display correctly?