metanorma / metanorma-ogc

Metanorma processor for OGC documents
https://www.metanorma.com
BSD 2-Clause "Simplified" License
2 stars 3 forks source link

WARNING: and IMPORTANT: admonitions are barely noticeable in HTML rendering #673

Open jerstlouis opened 1 month ago

jerstlouis commented 1 month ago

They don't get any kind of box or background color, or even bold on the WARNING / IMPORTANT.

CAUTION: gets a very nice box. It would be nice that each of these get a different color. WARNING: should probably be a bit more red-orange than CAUTION:? IMPORTANT: could be a nice pale green box?

important

caution

In the PDF rendering, they all render with a blue box (and are therefore all quite visible), but different colors would be nice such as orange for warning / cautions, and perhaps again green for IMPORTANT?

cautionPDF

opoudjis commented 1 month ago

Pretty sure I've done this with other flavours. Will investigate what I've done elsewhere, but will need approval from OGC leads of our colour choices, and whether we should introduce them. @Intelligent2013 we should have consistent choices too.

Intelligent2013 commented 1 month ago

In the PDF rendering, they all render with a blue box (and are therefore all quite visible), but different colors would be nice such as orange for warning / cautions, and perhaps again green for IMPORTANT?

@Intelligent2013 we should have consistent choices too.

I need the exactly RGB color for each admonition type, and I'll update the XSLT for PDF.

ronaldtse commented 1 month ago

@Intelligent2013 what are the colors we use right now for the OGC theme? I wonder if we can keep the HTML / PDF color definitions aligned.

Intelligent2013 commented 1 month ago

@Intelligent2013 what are the colors we use right now for the OGC theme? I wonder if we can keep the HTML / PDF color definitions aligned.

ronaldtse commented 1 month ago

@Intelligent2013 can we change the document date < 20211108 thing to a new layout for OGC? i.e. legacy layout vs new layout (202x?)

ronaldtse commented 1 month ago

We need assistance from @ghobona and @gbuehler here on defining the OGC colors on behalf of DocTeam.

Intelligent2013 commented 1 month ago

@Intelligent2013 can we change the document date < 20211108 thing to a new layout for OGC? i.e. legacy layout vs new layout (202x?)

@ronaldtse do you mean to use the document attribute :document-scheme: legacy instead of hard-coded date 20211108? Yes, will do so.

ronaldtse commented 1 month ago

@Intelligent2013 Correct.

ghobona commented 1 month ago

Please stick with the colors of the current OGC theme. You can use contrast to emphasise a block such as a warning, but please stick with the colors of the current OGC theme.

jerstlouis commented 1 month ago

@ghobona The problem is that right now:

So the OGC theme is missing colors... I like @ronaldtse 's suggestiong of keeping HTML / PDF colors aligned.

Any new colors added should fit with the existing OGC color scheme. Could the metanorma team maybe suggest / show what the new colors could look like and @ghobona and @gbuehler could review / approve it? Thanks all.

opoudjis commented 2 weeks ago

Inject colour palette into Presentation XML as metadata; OGC colour theme is being revised in brand guidelines.

We are to suggest complementary palette. Base off PDF.

opoudjis commented 1 week ago

So the following statements in the PDF XSLT:

<xsl:variable name="color_main">rgb(88, 89, 91)</xsl:variable>
    <xsl:variable name="color_design">
        <xsl:choose>
            <xsl:when test="$layoutVersion = '2022'">rgb(0, 177, 255)</xsl:when>
            <xsl:otherwise>rgb(237, 193, 35)</xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="color_design_light">
        <xsl:choose>
            <xsl:when test="$layoutVersion = '2022'">rgb(0, 177, 255)</xsl:when>
            <xsl:otherwise>rgb(246, 223, 140)</xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="color_dl_dt">rgb(215,243,255)</xsl:variable>
    <xsl:variable name="color_dl_dd">rgb(242,251,255)</xsl:variable>
    <xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
    <xsl:variable name="color_background_blue">rgb(33,60,107)</xsl:variable>

and the inline instances:

<xsl:choose>
                    <xsl:when test="$kind = 'preferred'">rgb(249, 235, 187)</xsl:when>
                    <xsl:when test="$kind = 'deprecated'">rgb(237, 237, 238)</xsl:when>
                    <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>                           
                </xsl:choose>

are to be migrated into Presentation XML metadata. I will code them as rgb() statements; HTML CSS will be able to cope with them, but I am going to assume that Word CSS will not, so

  red = color_json[:red].to_i
  green = color_json[:green].to_i
  blue = color_json[:blue].to_i
  color_value = sprintf("#%02x%02x%02x", r, g, b)
opoudjis commented 1 week ago

For the distinction between deprecated and admitted: I see that in Presentation XML, both are labelled "AdmittedLabel". I will change deprecated to be labelled "DeprecatedLabel", to simplify the test; I had not been differentiating them until now.

opoudjis commented 1 week ago

We import _coverpage.scss into htmlstyle.scss as import. We apply Liquid to populate the htmlstyle.scss; that does not extend to _coverpage.scss, so the Liquid imported from _coverpage.scss is illegal.

I'm going to work around that by importing the colours into the font-header of the SCSS as SCSS variables.

opoudjis commented 1 week ago

i will circulate the current PDF, and four versions of the HTML:

I've done the second.

opoudjis commented 1 week ago

@ghobona @gbuehler This is where I've got to. Please provide feedback.

I do need to note that I don't do front end (as you already know), and the notion of picking colours throws me into panic. If you don't like any of the alternatives, I will need you to suggest colours.

So, in the attached:

Archive 3.zip

opoudjis commented 1 week ago

Debugged: class "Adminition.Warning" in CSS should have been "Admonition Warning"

opoudjis commented 1 week ago

@ghobona @gbuehler Because this involves coordinating PDF and HTML, could we ask for some in principle feedback of which HTML you hate least? We can always tweak the colours later on.

I am worried that the background colour is going to wash out the theme colour pastels (since they were designed for a PDF white background); but I didn't want to change the HTML background colour to white without you giving go-ahead.