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

Use presentation-metadata for colours #698

Closed
opoudjis opened this issue Jul 15, 2024 · 14 comments
Closed

Use presentation-metadata for colours #698

opoudjis opened this issue Jul 15, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link
Contributor

From #673:

colours are going to be included in Presentation XML metadata from now on, including the logic about the dependence of colours on the schema. That is so that there is a single source of truth about colours for both HTML and PDF:

    <presentation-metadata>
      <name>color_main</name>
      <value>rgb(88, 89, 91)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_design</name>
      <value>rgb(237, 193, 35)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_design_light</name>
      <value>rgb(246, 223, 140)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_dl_dt</name>
      <value>rgb(215, 243, 255)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_dl_dd</name>
      <value>rgb(242, 251, 255)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_blue</name>
      <value>rgb(33, 55, 92)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_background_blue</name>
      <value>rgb(33, 60, 107)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_preferred</name>
      <value>rgb(249, 235, 187)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_deprecated</name>
      <value>rgb(237, 237, 238)</value>
    </presentation-metadata>
    <presentation-metadata>
      <name>color_admitted</name>
      <value>rgb(223, 236, 249)</value>
    </presentation-metadata>
@opoudjis opoudjis added the enhancement New feature or request label Jul 15, 2024
@ronaldtse
Copy link
Contributor

For the names of the colors can we make them meaningful? Since this is an exercise we would likely not revisit in a long time. Thanks.

@Intelligent2013
Copy link
Contributor

I propose to rename the colors as follows

  • color_main -> color-text
    Note: for document body text.

  • color_design -> color-secondary-shade-1
    Note: for the text on the cover page, unordered list labels, 'crossing lines' design element, color of circle for section's number, ToC.

  • color_design_light -> color-secondary-shade-2
    Note: for the crossing lines design element on the preface pages.

  • color_dl_dt -> color-background-definition-term
    Note: for the background of definition term.

  • color_dl_dd -> color-background-definition-description
    Note: for the background of definition description.

  • color_blue -> color-text-title and color-background-page
    Note: for clause, table, figure, list titles, for cover page and section pages background color.
    Note: for OGC 'white-paper' document the value is rgb(68, 84, 106).

  • color_background_blue -> color-background-text-label-legacy
    Note: for background color for the label Legacy and bottom text about 'legacy' document on the cover page

  • color_preferred-> color-background-term-preferred-label

  • color_preferred-> color-background-term-deprecated-label

  • color_preferred-> color-background-term-admitted-label
    Note: for background for the labels 'PREFERRED, DEPRECATED, ADMITTED`

Also, there are more colors that should be added:

  • color-background-table-header rgb(33, 55, 92)
    Note: for table header background.

  • color-background-table-row-even rgb(252, 246, 222)
    Note: for 'even' table rows background.

  • color-background-table-row-odd rgb(254, 252, 245)
    Note: for 'odd' table rows background.

  • color-admonition-note

  • color-admonition-tip

  • color-admonition-editor

  • color-admonition-important

  • color-admonition-warning

  • color-admonition-caution

  • color-admonition-todo

  • color-admonition-safety-precaution
    Note: for admonition text and border around it, the current value for all is rgb(79, 129, 189).

@opoudjis
Copy link
Contributor Author

OK, that's fine by me. I will note though that I am having trouble with the mapping to the HTML colours, and I may have questions.

Proceeding with these renamings.

@opoudjis
Copy link
Contributor Author

Oh, 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
Copy link
Contributor Author

  <metanorma-extension>
       <presentation-metadata>
       <name>color-admonition-caution</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-editor</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-important</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-note</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-safety-precaution</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-tip</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-todo</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-admonition-warning</name>
       <value>rgb(79, 129, 189)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-definition-description</name>
       <value>rgb(242, 251, 255)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-definition-term</name>
       <value>rgb(215, 243, 255)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-page</name>
       <value>rgb(33, 55, 92)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-table-header</name>
       <value>rgb(33, 55, 92)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-table-row-even</name>
       <value>rgb(252, 246, 222)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-table-row-odd</name>
       <value>rgb(254, 252, 245)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-term-admitted-label</name>
       <value>rgb(223, 236, 249)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-term-deprecated-label</name>
       <value>rgb(237, 237, 238)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-term-preferred-label</name>
       <value>rgb(249, 235, 187)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-background-text-label-legacy</name>
       <value>rgb(33, 60, 107)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-secondary-shade-1</name>
       <value>rgb(237, 193, 35)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-secondary-shade-2</name>
       <value>rgb(246, 223, 140)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-text</name>
       <value>rgb(88, 89, 91)</value>
     </presentation-metadata>
     <presentation-metadata>
       <name>color-text-title</name>
       <value>rgb(33, 55, 92)</value>
     </presentation-metadata>
      <presentation-metadata>
        <name>TOC Heading Levels</name>
        <value>2</value>
      </presentation-metadata>
      <presentation-metadata>
        <name>HTML TOC Heading Levels</name>
        <value>2</value>
      </presentation-metadata>
      <presentation-metadata>
        <name>DOC TOC Heading Levels</name>
        <value>2</value>
      </presentation-metadata>
      <presentation-metadata>
        <name>PDF TOC Heading Levels</name>
        <value>2</value>
      </presentation-metadata>
    </metanorma-extension>

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Jul 15, 2024
@Intelligent2013
Copy link
Contributor

OGC XSLT updated in metanorma/mn-native-pdf#720.
PR need to merge after metanorma-ogc update only.

@opoudjis
Copy link
Contributor Author

I've submitted the HTML outputs for review, I'll ask that they get to it this week...

@ronaldtse
Copy link
Contributor

@opoudjis there is a mention here for legacy colors being outputted with the *-legacy prefix.

We should actually refactor out the legacy design to a new "layout" like we have for ISO, so it is consistent across flavors.

@opoudjis
Copy link
Contributor Author

@opoudjis there is a mention here for legacy colors being outputted with the *-legacy prefix.

We should actually refactor out the legacy design to a new "layout" like we have for ISO, so it is consistent across flavors.

You misunderstand:

Note: for background color for the label Legacy and bottom text about 'legacy' document on the cover page

This is not a legacy colour, and it will not be treated as one.

@ronaldtse
Copy link
Contributor

OK, thanks @opoudjis .

@opoudjis
Copy link
Contributor Author

opoudjis commented Aug 5, 2024

This is going to take months to resolve, @Intelligent2013, I'm going to try and create a version of the PR that leaves the PDF unaffected. But for now, ignore all rendering colours associated with admonitions, and stick with original colours.

@Intelligent2013
Copy link
Contributor

Updated OGC XSLT in PR metanorma/mn-native-pdf#720. On hold.

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Aug 12, 2024
@Intelligent2013
Copy link
Contributor

I've added the default colors into OGC XSLT. They will be applied if colors are missing in the presentation-metadata.

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Aug 12, 2024
@opoudjis
Copy link
Contributor Author

Really sorry about the delay. I will merge the PR and ignore it in my HTML CSS, so at least you won't be impacted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants