diff --git a/.stylelintrc.json b/.stylelintrc.json index 7cad7a1..fa85b92 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,3 +1,11 @@ { - "extends": "stylelint-config-standard" + "extends": "stylelint-config-standard", + "rules": { + "selector-pseudo-class-no-unknown": [ + true, + { + "ignorePseudoClasses": ["global"] + } + ] + } } diff --git a/src/components/KinkCheck.module.css b/src/components/KinkCheck.module.css index f26c2b5..b7105ff 100644 --- a/src/components/KinkCheck.module.css +++ b/src/components/KinkCheck.module.css @@ -21,8 +21,8 @@ } @media screen and (width <= 800px) { - .category, - .table { + :global(body:not(.screenshot)) .category, + :global(body:not(.screenshot)) .table { width: 100%; } } diff --git a/src/components/RatingOverview.astro b/src/components/RatingOverview.astro index 5596493..2afd824 100644 --- a/src/components/RatingOverview.astro +++ b/src/components/RatingOverview.astro @@ -18,7 +18,7 @@ import Rater from "./Rater"; font-size: 16pt; } @media screen and (width <= 800px) { - div { + :global(body:not(.screenshot)) div { justify-content: space-between; } } diff --git a/src/components/ScreenshotButton.tsx b/src/components/ScreenshotButton.tsx index d3637e0..f83f447 100644 --- a/src/components/ScreenshotButton.tsx +++ b/src/components/ScreenshotButton.tsx @@ -8,6 +8,7 @@ export default function ScreenshotButton({ title, options = {} }: { title: strin { // TODO: be able to pass in a selector for what to screenshot const content = document.querySelector("div#content") as HTMLElement; + document.body.classList.add("screenshot"); content.style.width = options.windowWidth + "px"; const canvas = await html2canvas(content, { backgroundColor: "black", @@ -16,6 +17,7 @@ export default function ScreenshotButton({ title, options = {} }: { title: strin scale: window.orientation !== undefined ? 1 : 2, ...options }); + document.body.classList.remove("screenshot"); content.style.width = ""; const date = new Date().toISOString()