Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/wet-llamas-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/math-input": minor
"@khanacademy/perseus": minor
---

Break Perseus styling into its own Cascade Layers
8 changes: 6 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {mergeConfig} from "vite";
import {configureSort} from "storybook-multilevel-sort";
import type {StorybookConfig} from "@storybook/react-vite";
Expand All @@ -14,8 +14,12 @@
if (pathname.endsWith(".css")) {
// Exclude the CSS files that are not part of the shared layer.
if (!excludedCssFiles.some((file) => pathname.endsWith(file))) {
// Exclude any CSS file that already has a layer statement.
if (!code.includes("@layer")) {
// Exclude any CSS file that already has a layer statement,
// unless it is specifying a sub-layer.
if (
!code.includes("@layer") ||
/(?=.*@layer)(?=.*\bperseus-legacy\b)/s.test(code)
) {
const layerStatements =
"@layer reset, shared, legacy;\n@layer shared";
return {
Expand Down
5 changes: 4 additions & 1 deletion packages/math-input/styles/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@import "mathquill/build/mathquill.css";
@layer libraries, perseus-legacy;

@import "mathquill/build/mathquill.css" layer(libraries);

.keypad-input {
outline: none !important;
}
Expand Down
Loading
Loading