Skip to content

Documentation: Add theme validation guidance to spo theme set command #1633

Description

@garrytrinder

Raised from #1631

We should add guidance to the spo theme set command to cover how we validate themes supplied to the command and provide a good example for people to follow.

A valid theme object is as follows

{
    "themePrimary": "#d81e05",
    "themeLighterAlt": "#fdf5f4",
    "themeLighter": "#f9d6d2",
    "themeLight": "#f4b4ac",
    "themeTertiary": "#e87060",
    "themeSecondary": "#dd351e",
    "themeDarkAlt": "#c31a04",
    "themeDark": "#a51603",
    "themeDarker": "#791002",
    "neutralLighterAlt": "#eeeeee",
    "neutralLighter": "#f5f5f5",
    "neutralLight": "#e1e1e1",
    "neutralQuaternaryAlt": "#d1d1d1",
    "neutralQuaternary": "#c8c8c8",
    "neutralTertiaryAlt": "#c0c0c0",
    "neutralTertiary": "#c2c2c2",
    "neutralSecondary": "#858585",
    "neutralPrimaryAlt": "#4b4b4b",
    "neutralPrimary": "#333333",
    "neutralDark": "#272727",
    "black": "#1d1d1d",
    "white": "#f5f5f5"
}

Validation checks the following:

  • the specified string is a valid JSON string
  • the deserialized object contains all properties defined in the above example
  • the deserialized object doesn't contain any other properties
  • each property of the deserialized object contains a valid hex color value prefixed with a #

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions