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

Update styling in the component library and Storybook to use emotion 10 #435

Closed
4 tasks
bradfordjanice opened this issue Mar 19, 2019 · 3 comments
Closed
4 tasks
Labels
planning:Epic A single issue that documents a large project bridging multiple issues.

Comments

@bradfordjanice
Copy link
Contributor

bradfordjanice commented Mar 19, 2019

Currently styles are written in multiple ways in the component library, Storybook.

For example: civic/packages/component-library/assets/global.styles.css is CSS.

For consistency, update styles in the component library and Storybook to use css-in-js emotion v.10. Check to make sure all changes to build dependencies are complete before working on this.

@DingoEatingFuzz DingoEatingFuzz added type:component-lib planning:Epic A single issue that documents a large project bridging multiple issues. labels Mar 29, 2019
@DingoEatingFuzz
Copy link
Contributor

This ticket could use a break down of all the offending components. That way contributors can chip away at the list one by one with smaller PRs.

@bradfordjanice
Copy link
Contributor Author

Incremental Migration to Emotion 10

Upgrading to Emotion 10 is described on the Emotion website; you will find code examples and more details here: https://emotion.sh/docs/migrating-to-emotion-10

The upgrades to emotion 10 are split into two parts.

  1. Automatically: The first part can be done automatically by using eslint-plugin-emotion at https://emotion.sh/docs/eslint-plugin-emotion#emotion-10-codemods. This will make the following changes:
    a. Change all react-emotion imports so that styled is imported from @emotion/styled and all the emotion exports are split into a second import.
    b. Add a css call to the css prop when a template literal is used.
    c. Add a jsx import and set jsx pragma

  2. Manually (after step 1 is complete): These changes can be made incrementally, by component or story, over time.
    a. Add compat cache with provider.
    b. Change css usage to css prop.

    Update these components in the directory component-library/src:
    BaseMap
    Button
    ChartContainer
    ChartTitle
    CivicCardStack
    CivicSandboxDashboard
    CivicSandboxMap
    CivicStoryCard
    Collapsable
    DataTable
    Dropdown
    Footer
    HeatMap
    Hero
    HexOverlay
    IconMap
    LandingPage
    Logo
    MapOverlay
    MapTooltip
    Media
    Navigation
    PackageSelectorBox
    PageLayout
    PathMap
    PDF
    Placeholder
    PullQuote
    RechartsPie
    Sandbox
    Sankey
    ScatterPlotMap
    ScrollToTop
    SimpleLegend
    Slider
    StoryCard
    Tag
    VictoryTheme
    Note: Research the following components to see whether they need to be updated:
    ?AreaChart
    ?BarChart
    ?BoundaryMap
    ?Chart
    ?ChartData
    ?GradientBox
    ?HorizontalBarChart
    ?Icon
    ?LeafletMap
    ?LineChart
    ?PieChart
    ?Scatterplot
    ?ScreenGridMap
    ?StackedAreaChart

    Update all the style guideline stories in the directory component-library/stories/styleGuideStories
    In addition, update these stories in the directory component-library/stories:
    Button
    CivicSandboxDashboard
    DropdownMenu
    LineChart
    PackageSelectorBox
    PageLayout
    Sandbox
    Scatterplot
    Slider
    StackedAreaChart
    storyStyles

@jaronheard
Copy link
Contributor

Merged into #556

2019 Front-End Team automation moved this from Backlog to Done Jun 1, 2019
@jaronheard jaronheard removed this from Done in 2019 Front-End Team Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
planning:Epic A single issue that documents a large project bridging multiple issues.
Projects
None yet
Development

No branches or pull requests

3 participants