From 547b80bd47f64feb598ac0148198e4e3a58c118b Mon Sep 17 00:00:00 2001 From: dmitrsavk Date: Mon, 21 Jun 2021 17:41:32 +0300 Subject: [PATCH 1/2] feat(themes): change colors building --- bin/build-themes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-themes.js b/bin/build-themes.js index 3b7f39bb2d..418ac84112 100755 --- a/bin/build-themes.js +++ b/bin/build-themes.js @@ -91,7 +91,7 @@ const processPostCss = async (content, cssFile) => fs.writeFileSync(`../css/colors/${path.basename(file)}`, css); fs.writeFileSync( `../css/colors/${path.basename(file).replace(/\.css$/, '.js')}`, - `module.exports = \`${css}\``, + `module.exports = \`${vars}\``, ); }); From 8a8ec3cf2ceef6bb0422f65439f81381273f2dda Mon Sep 17 00:00:00 2001 From: dmitrsavk Date: Mon, 21 Jun 2021 17:43:21 +0300 Subject: [PATCH 2/2] feat(dark-theme-styles-injector): add prop for selector --- .../src/component.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/dark-theme-styles-injector/src/component.tsx b/packages/dark-theme-styles-injector/src/component.tsx index 7371599165..2f949ea335 100644 --- a/packages/dark-theme-styles-injector/src/component.tsx +++ b/packages/dark-theme-styles-injector/src/component.tsx @@ -9,18 +9,35 @@ const colorsMap = { }; export type DarkThemeStylesInjectorProps = { + /** + * Какие цвета необходимо инвертировать + */ colors: 'indigo' | 'bluetint'; + + /** + * Дополнительные стили для инвертированного режима + */ styles?: string; + + /** + * Селектор, в котором будут переопределяться переменные + */ + selector?: string; }; export const DarkThemeStylesInjector: FC = ({ colors, styles = '', + selector = ':root', }) => { return ( ); };