Page MenuHomePhabricator

docs: Document how to include Codex CSS when using Codex via npm
Closed, ResolvedPublic1 Estimated Story Points

Description

Problem

When you use a Codex component by requiring the @wikimedia/codex package from NPM and importing a component in your code, most build tools will not automatically pull in that component's CSS. Instead, you have to manually load it somewhere. This is not clearly documented and should be.

Solution

Document how to include CSS on the Usage page, and consider adding a note or full instructions to the main repo's README.

The compiled CSS can be included in the following ways:

  • In the main entry scripe, e.g. import '@wikimedia/codex/dist/codex.style.css';
  • In a CSS or Less file, e.g. @import '@wikimedia/codex/dist/codex.style.css';
  • In a <link> element in the <head> of the document if you want to party like it's 1999

Acceptance criteria

  • Document inclusion of Codex CSS when using the npm package in the Usage docs
  • Consider also adding a note, or full instructions, in the README

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
AnneT set the point value for this task to 1.
AnneT moved this task from Inbox to Up Next on the Design-System-Team board.

Change 972321 had a related patch set uploaded (by Tyhopp; author: Tyhopp):

[design/codex@main] docs: Add Codex CSS import methods to usage page

https://gerrit.wikimedia.org/r/972321

Hi, I hope it's fine a took a swing at this. I opted not to include the README change in favor of doing that within the scope of https://phabricator.wikimedia.org/T301730.

Change 972321 merged by jenkins-bot:

[design/codex@main] docs: Add Codex CSS import methods to usage page

https://gerrit.wikimedia.org/r/972321

Change 980902 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[mediawiki/core@master] Update Codex from v1.0.1 to v1.1.1

https://gerrit.wikimedia.org/r/980902

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/d419984345/w

Change 980902 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.0.1 to v1.1.1

https://gerrit.wikimedia.org/r/980902