openedx / openedx/paragon

[design tokens]: Adding images through brand packages

Open
#3,707 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design tokens
Dominant language
JavaScript
Stars
140
Forks
100
Avg merge
1h 3m
Merged PRs (30d)
30

Description

Description

Currently, when there is a need to add images via CSS (background-image) and the corresponding design token that generates the corresponding CSS change, there is a problem with relative links. Consumers can generate CSS variables that will reference an image that is in the dist theme/brand package (relative link). But this link will change when the CSS variable is used in the MFE. It will be relative to the MFE (React app).

For example:

Design token in elm-theme:

  "catalog-home-page-banner-background-image": {
    "$value": "home-bg.jpg",
    "$type": "asset",
    "$description": "Catalog Home page background image."
  }

The path to home-bg.jpg relative to dist:

https://cdn.jsdelivr.net/gh/raccoongang/elm-theme@474e869cb03bb000c2d44f87bae2000c35826e6a/dist/home-bg.jpg

The path that gets var(--catalog-home-page-banner-bg) variable:

http://apps.local.openedx.io:1998/catalog/home-bg.jpg

More context: https://github.com/openedx/frontend-app-catalog/pull/7#discussion_r2228141749

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the design-token asset example and the linked frontend-app-catalog discussion. The issue names no files, tests, or entry points, and it does not define the expected implementation or acceptance criteria. Clarify how image URLs should resolve for consumers before choosing a code path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.