diff --git a/code/core/assets/server/base-preview-head.html b/code/core/assets/server/base-preview-head.html index dacc8ef5d52c..d139fd4f6191 100644 --- a/code/core/assets/server/base-preview-head.html +++ b/code/core/assets/server/base-preview-head.html @@ -147,84 +147,80 @@ border: 1px solid #ff0000; box-shadow: 0 0 64px rgba(0, 0, 0, 0.1); gap: 24px; + } - & ol { - padding-left: 18px; - margin: 0; - } + .sb-errordisplay_main ol { + padding-left: 18px; + margin: 0; + } - /* Redefine colors to ensure readability regardless of user-provided * selectors. */ - * { - background: white; - color: black; - } + /* Prevent wildcard leakage */ + .sb-errordisplay_main * { + background: white; + color: black; + } - & h1 { - font-family: Nunito Sans; - font-size: 22px; - font-weight: 400; - line-height: 30px; - font-weight: normal; - margin: 0; - - &::before { - content: ''; - display: inline-block; - width: 12px; - height: 12px; - background: #ff4400; - border-radius: 50%; - margin-right: 8px; - } - } + .sb-errordisplay_main h1 { + font-family: Nunito Sans; + font-size: 22px; + font-weight: 400; + line-height: 30px; + margin: 0; + } - & p, - & ol { - font-family: Nunito Sans; - font-size: 14px; - font-weight: 400; - line-height: 19px; - margin: 0; - } + .sb-errordisplay_main h1::before { + content: ''; + display: inline-block; + width: 12px; + height: 12px; + background: #ff4400; + border-radius: 50%; + margin-right: 8px; + } - & li + li { - margin: 0; - padding: 0; - padding-top: 12px; - } + .sb-errordisplay_main p, + .sb-errordisplay_main ol { + font-family: Nunito Sans; + font-size: 14px; + font-weight: 400; + line-height: 19px; + margin: 0; + } - & a { - color: currentColor; - } + .sb-errordisplay_main li + li { + padding-top: 12px; + } - & .sb-errordisplay_code { - padding: 10px; - flex: 1; - background: #242424; - color: #c6c6c6; - box-sizing: border-box; - - font-size: 14px; - font-weight: 400; - line-height: 19px; - border-radius: 4px; - - font-family: - 'Operator Mono', 'Fira Code Retina', 'Fira Code', 'FiraCode-Retina', 'Andale Mono', - 'Lucida Console', Consolas, Monaco, monospace; - margin: 0; - overflow: auto; - - & code { - background-color: inherit; - color: inherit; - } - } + .sb-errordisplay_main a { + color: currentColor; + } - & .sb-errordisplay pre { - white-space: pre-wrap; - white-space: revert; - } + .sb-errordisplay_main .sb-errordisplay_code { + padding: 10px; + flex: 1; + background: #242424; + color: #c6c6c6; + box-sizing: border-box; + + font-size: 14px; + line-height: 19px; + border-radius: 4px; + + font-family: + 'Operator Mono', 'Fira Code Retina', 'Fira Code', 'FiraCode-Retina', 'Andale Mono', + 'Lucida Console', Consolas, Monaco, monospace; + + margin: 0; + overflow: auto; + } + + .sb-errordisplay_main .sb-errordisplay_code code { + background-color: inherit; + color: inherit; + } + + .sb-errordisplay_main .sb-errordisplay pre { + white-space: revert; } @-webkit-keyframes sb-rotate360 { diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000000..298a67b4fa89 --- /dev/null +++ b/flake.nix @@ -0,0 +1,18 @@ +{ + description = "storybook dev environment"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + devShells.${system}.default = pkgs.mkShell { + packages = with pkgs; [ + nodejs + pnpm + ]; + }; + }; +}