Skip to content

Commit

Permalink
fix(storybook): set dir attribute in storybook for rtl (#11031)
Browse files Browse the repository at this point in the history
* fix(storybook): set dir attribute in storybook for rtl

* fix(storybook): rtl - change postcss loader options object

* fix(storybook): downgrade rtlcss
  • Loading branch information
annawen1 authored and IgnacioBecerra committed Nov 1, 2023
1 parent e7cb631 commit b4f26f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/web-components/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import customElementsMetadata from '../custom-elements.json';

setCustomElements(customElementsMetadata);

if (process.env.STORYBOOK_USE_RTL === 'true') {
document.documentElement.setAttribute('dir', 'rtl');
}

export const parameters = {
layout: 'fullscreen',
options: {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"rollup-plugin-inject-process-env": "^1.3.1",
"rollup-plugin-multi-input": "^1.3.1",
"rollup-plugin-sizes": "^1.0.4",
"rtlcss": "^3.0.0",
"rtlcss": "^2.4.0",
"sass-loader": "^10.0.0",
"strip-comments": "^1.0.0",
"style-loader": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@ __metadata:
rollup-plugin-inject-process-env: ^1.3.1
rollup-plugin-multi-input: ^1.3.1
rollup-plugin-sizes: ^1.0.4
rtlcss: ^3.0.0
rtlcss: ^2.4.0
sass-loader: ^10.0.0
strip-comments: ^1.0.0
style-loader: ^2.0.0
Expand Down

0 comments on commit b4f26f2

Please sign in to comment.