Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Implement new font method in Headings component #343

Closed
1 task
mgurgel opened this issue Mar 11, 2019 · 2 comments
Closed
1 task

Implement new font method in Headings component #343

mgurgel opened this issue Mar 11, 2019 · 2 comments
Assignees
Labels
ws-home Tasks for the WS Home Team
Milestone

Comments

@mgurgel
Copy link
Contributor

mgurgel commented Mar 11, 2019

Blocked by #342

Is your feature request related to a problem? Please describe.
World Service has a UX requirement that GEL Types (Canon, Long Primer, Double Pica, etc) should allow for mutable values across services. These values were grouped into 11 different scripts: arabic, arabic-pashto, bengali, burmese, devanagari-and-gurmukhi, latin-and-cyrillic, latin-with-diacritics, no-ascenders-or-descenders, sinhalese, tamil, and thai.

The latin-and-cyrillic script contains the default values GEL for all the Types. The previous constants (GEL_CANON, GEL_LONG_PRIMER, GEL_DOUBLE_PICA, etc) are being deprecated in favour of script-specific methods such as getCanon(), getLongPrimer() and so on. These methods take the current component's script as an argument.

This issue is part of a wider work to update all existing components to use the new methods, eventually removing the old constants from the codebase.

Describe the solution you'd like

  • Allow the component to pass the script name and children as a prop.
  • Update the component's propTypes and defaultProps to include a prop of script that defaults to latin
  • Import the appropriate getTypeSizes() method for the component's Type Styles (getCannon for Headline, getTrafalgar for Subheading)
  • Implement the method above, replacing any references to the deprecated GEL Type constant (GEL_CANON, GEL_TRAFALGAR) in the styled-component CSS string
  • Remove existing imports of the previous GEL Type constant

Testing notes
[Tester to complete]

Dev insight: Will Cypress tests be required or are unit tests sufficient? Will there be any potential regression? etc

Additional context
Add any other context or screenshots about the feature request here.

@mgurgel mgurgel added the ws-home Tasks for the WS Home Team label Mar 11, 2019
@j-pendlebury j-pendlebury self-assigned this Mar 11, 2019
@sareh
Copy link
Contributor

sareh commented Mar 15, 2019

Prior to the work being done for adding the script props to the front-end components such as this one, could you please have a short write-up in an ADR explaining the approach? Thanks!

@mgurgel mgurgel changed the title Implement script prop in Headline component Implement new font method in Headings component Mar 15, 2019
@alex-magana
Copy link
Contributor

As indicated above #344 had been closed in favour of this issue since the work for Headline and SubHeading is to be done in the psammead-headings component.
cc @jblaut

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ws-home Tasks for the WS Home Team
Projects
None yet
Development

No branches or pull requests

6 participants