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

feat(logo): Support alt text for logos via BrandLogoResource #29

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

gadenbuie
Copy link
Collaborator

@gadenbuie gadenbuie commented Oct 16, 2024

For #19

All paths in logo are now promoted to BrandLogoResource instances. This adds a bit of overhead but makes the Brand instance consistent, where consumers can always look in *.path for the path to a resource which will have an adjacent, optional, .alt property.

This also means that logo: <string> values are promoted to BrandLogoResources, so consumers can expect logo to be either a full BrandLogo or a simple BrandLogoResource:

# Can be written like this
logo: brand-yaml.png

# Parsed into the equivalent of this (alt would be missing)
logo:
  path: brand-yaml.png
  alt: The Brand YAML logo

The examples/brand-logo-full-alt.yml file gives a complete example with all options

logo:
  images:
    mark: 
      path: logos/pandas/pandas_mark.svg
      alt: pandas logo with blue bars and yellow and pink dots
    mark-white: logos/pandas/pandas_mark_white.svg
    secondary: logos/pandas/pandas_secondary.svg
    secondary-white: 
      path: logos/pandas/pandas_secondary_white.svg
      alt: pandas logo with bars and dots over the word "pandas"
    pandas: logos/pandas/pandas.svg
    pandas-white: logos/pandas/pandas_white.svg
  small: mark
  medium:
    light: 
      path: logos/pandas/pandas_secondary.svg
      alt: pandas logo with bars and dots over the word "pandas"
    dark: secondary-white
  large: 
    path: logos/pandas/pandas.svg
    alt: pandas bars and dots to the right of the word "pandas"

* Also expose `BrandLogoResource` at top-level
* `brand.logo` can be a string, logo resource or `BrandLogo`
* improve docs
@gadenbuie gadenbuie merged commit 0429e5d into main Oct 16, 2024
5 checks passed
@gadenbuie gadenbuie deleted the feat/brand-logo-resource branch October 17, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant