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

Add object literal representation of typography presets #1283

Merged
merged 4 commits into from Mar 15, 2024

Conversation

jamesmockett
Copy link
Contributor

What are you changing?

Adds object literal representation of the web typography presets.

export const article15Object = {
  fontFamily: 'GuardianTextEgyptian, "Guardian Text Egyptian Web", Georgia, serif',
  fontSize: '0.9375rem',
  lineHeight: 1.4,
  fontWeight: 400,
  fontStyle: 'normal',
};

@jamesmockett jamesmockett self-assigned this Mar 14, 2024
@jamesmockett jamesmockett requested review from a team as code owners March 14, 2024 16:16
Copy link

changeset-bot bot commented Mar 14, 2024

⚠️ No Changeset found

Latest commit: d2bc784

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the 📦 npm Affects a @guardian package on NPM label Mar 14, 2024
Copy link
Contributor

Tip

Once this PR is ready to go, add the run_chromatic label to run the Chromatic tests.

This saves us a lot of money by not running the tests before we need them.

@jamesmockett jamesmockett linked an issue Mar 14, 2024 that may be closed by this pull request
Copy link
Contributor

@oliverabrahams oliverabrahams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks gd

@oliverabrahams oliverabrahams merged commit d28774a into jm/type-preset-release-branch Mar 15, 2024
10 checks passed
@oliverabrahams oliverabrahams deleted the jm/preset-objects branch March 15, 2024 16:22
@mxdvl
Copy link
Member

mxdvl commented Mar 25, 2024

Would we want these objects to be marked as const, so their values are literals rather than primitives?

@jamesmockett
Copy link
Contributor Author

Would we want these objects to be marked as const, so their values are literals rather than primitives?

I hadn't thought of that, but yes, I think that's a good idea 👍

jamesmockett added a commit that referenced this pull request Apr 16, 2024
* Basic build script to generate presets vars

* Format build output with Prettier

* Move build script to nx target

* Add presets to exports and export tests

* Strip additional whitespace and tabs from output

* Add building presets as dependency to build task

* Update incorrect font sizes in Text Sans presets

* Add preset examples to tests

* Convert px font sizes to rems

* Update build script messaging

* Add complete set of tests for all presets

* Add typography presets and examples to Storybook

* Show type properties alongside examples

* Add Story block so presets are available as separate story

* Fix invalid markup

* Reinstate typography API docs and mark as deprecated

* Rename preset specimen renderer

* Basic build script to generate presets vars

* Format build output with Prettier

* Move build script to nx target

* Add presets to exports and export tests

* Strip additional whitespace and tabs from output

* Add building presets as dependency to build task

* Update incorrect font sizes in Text Sans presets

* Add preset examples to tests

* Convert px font sizes to rems

* Update build script messaging

* Add complete set of tests for all presets

* Move deprecated typography API docs to separate story

* Add text decoration style to preset CSS

* Add object literal representation of typography presets (#1283)

Add object literal representation of type presets

* Type preset objects `as const` (#1306)

* Relocate deprecated typography API code

* Mark typography API exports as deprecated

* Fix casing of 'italic' in tokens

* Pin tsx version

* move typography docs into `stories`

* auto-generated files are built to `vendor`

* add changeset

* format changeset

* Update references to generated code

* Make conversion function types more specific

* Update deprecation messages and add link to docs

* Add object style example

* Remove article and kicker presets

* Update docs to remove article and kicker

* Update link to mapping example in changelog

* Mark object style exports as deprecated

* Update story types and imports

* Rename object style exports so names are unique

* Fix linting errors

* Add note about getting assistance to changelog

* Update wording in changelog

Co-authored-by: Alex Sanders <alex@sndrs.dev>

---------

Co-authored-by: Max Duval <max.duval@theguardian.com>
Co-authored-by: Alex Sanders <alex@sndrs.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 npm Affects a @guardian package on NPM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export presets as objects
3 participants