diff --git a/src/components/code/code/text-and-code.module.css b/src/components/code/code/text-and-code.module.css index 2446604a..e8f1d549 100644 --- a/src/components/code/code/text-and-code.module.css +++ b/src/components/code/code/text-and-code.module.css @@ -19,4 +19,20 @@ flex: 0 0 60%; box-sizing: border-box; display: block; +} + +@media screen and (max-width: 768px) { + .text-and-code { + display: block; + } + + .text-and-code-content { + min-width: auto; + max-width: 100%; + } + + .text-and-code-sticker { + min-width: 100%; + max-width: 100%; + } } \ No newline at end of file diff --git a/src/components/code/scrollycoding.module.css b/src/components/code/scrollycoding.module.css index cf69488d..0fa1de49 100644 --- a/src/components/code/scrollycoding.module.css +++ b/src/components/code/scrollycoding.module.css @@ -21,16 +21,39 @@ .step { border-radius: 0; - padding: 24px; + padding: 10px; border: 0; border-left: 4px solid transparent; box-shadow: inset 0 1px #e3e8ee; margin: 0 0 0 -0.5rem; } -.step[data-selected="true"] { +.stepMobile { border-radius: 0; - padding: 24px; + padding: 5px; + border: 0; + border-left: 4px solid transparent; + box-shadow: inset 0 1px #e3e8ee; + margin: 0 0 0 -0.5rem; +} + +.stepMobile { + display: none; +} + +.step[data-selected="true"]{ + border-radius: 0; + padding: 10px; + box-shadow: inset 0 1px #e3e8ee; + margin: 0 0 0 -0.5rem; + border: 0; + border-left: 4px solid var(--ifm-color-secondary-darkest); + background-color: var(--docusaurus-highlighted-code-line-bg); +} + +.stepMobile[data-selected="true"]{ + border-radius: 0; + padding: 5px; box-shadow: inset 0 1px #e3e8ee; margin: 0 0 0 -0.5rem; border: 0; @@ -55,3 +78,25 @@ top: 4rem; overflow: auto; } + +@media screen and (max-width: 768px) { + .stepMobile { + display: block; + } + .step { + display: none; + } + .scrollycodingContainer { + flex-direction: column; + } + .stepsContainer { + min-width: auto; + max-width: 100%; + } + + .sticker { + min-width: 100%; + max-width: 100%; + height: auto; + } +} diff --git a/src/components/code/scrollycoding.tsx b/src/components/code/scrollycoding.tsx index 665fe0e2..adc59604 100644 --- a/src/components/code/scrollycoding.tsx +++ b/src/components/code/scrollycoding.tsx @@ -31,15 +31,28 @@ export function Scrollycoding(props: unknown) {
{steps.map((step, i) => ( - - {(step.title.length > 0) ?

{step.title}

: null} -
{step.children}
-
+ <> + + {(step.title.length > 0) ?

{step.title}

: null} +
{step.children}
+
+ {/*Mobile:*/} + + {(step.title.length > 0) ?

{step.title}

: null} +
{step.children}
+
+ + ))}