CAAPIM / themer

Framework agnostic utility to make generic JavaScript components themeable and extensible.
MIT License
1 stars 1 forks source link

Pass `theme.styles` as `props.classes` to themed snippets #20

Closed alebiavati closed 7 years ago

alebiavati commented 7 years ago

Status

READY

Description

Pass theme.styles as props.classes to themed snippets to allow for quick access to resolved theme styles.

Before change:

const snippet = ({ theme, content }) =>
  `<h1 class="${theme.styles.root}">` +
    `${content}` +
  '</h1>';

After change:

const snippet = ({ classes, content }) =>
  `<h1 class="${classes.root}">` +
    `${content}` +
  '</h1>';

Impacted Areas in Application

codecov-io commented 7 years ago

Codecov Report

Merging #20 into master will not change coverage. The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #20   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           6      6           
  Lines          96     96           
=====================================
  Hits           96     96
Impacted Files Coverage Δ
src/utils/index.js 100% <100%> (ø) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 47d9ecc...52df479. Read the comment docs.