From a5f09507422dba720608f0b884d893467b9d6143 Mon Sep 17 00:00:00 2001 From: Josh Collinsworth Date: Tue, 10 Dec 2024 16:54:48 -0600 Subject: [PATCH] Visual updates - Add more easily visible focus indication to toggle switches - Stylize contributions section - Touch up switch transitions and remove unneeded prefixes --- examples/_pages/LandingPage.tsx | 207 +++++++++++++++++--------------- styles.css | 15 ++- 2 files changed, 114 insertions(+), 108 deletions(-) diff --git a/examples/_pages/LandingPage.tsx b/examples/_pages/LandingPage.tsx index 357cba95..5d4eeca3 100644 --- a/examples/_pages/LandingPage.tsx +++ b/examples/_pages/LandingPage.tsx @@ -1,8 +1,8 @@ +import { ExampleIcon } from "../_components/ExampleIcon.tsx"; import { LearningList } from "../_components/LearningList.tsx"; -import { sidebar } from "../_data.ts"; import { TutorialIcon } from "../_components/TutorialIcon.tsx"; -import { ExampleIcon } from "../_components/ExampleIcon.tsx"; import { VideoIcon } from "../_components/VideoIcon.tsx"; +import { sidebar } from "../_data.ts"; export default function LandingPage() { const componentsPerSidebarItem = sidebar.map( @@ -17,108 +17,115 @@ export default function LandingPage() { ); return ( -
-
-
-

- Examples -

-

- A collection of walkthrough tutorials, examples, videos and guides - to teach you about the Deno runtime and how to use it with your - favorite tools. -

-
-
-

- Filter by type -

- + <> +
+
+
+

+ Examples +

+

+ A collection of walkthrough tutorials, examples, videos and guides + to teach you about the Deno runtime and how to use it with your + favorite tools. +

+
+
+

+ Filter by type +

+ - + - + +
-
-
- {componentsPerSidebarItem} -
-
-

- Oops! You've filtered everything +
+ {componentsPerSidebarItem} +
+
+

+ Oops! You've filtered everything +

+

+ Maybe remove a filter to see some examples? +

+ sad Deno with a grad cap +
+

+ + ); } diff --git a/styles.css b/styles.css index 0173f93b..f62d9c18 100644 --- a/styles.css +++ b/styles.css @@ -658,6 +658,11 @@ input[type="search"] { padding-bottom: 0.3em; } +label:has(.switch input:focus-visible) .slider { + outline: 2px solid var(--color-accent-fg); + outline-offset: 2px; +} + .switch { position: relative; width: 1.8rem; @@ -679,8 +684,7 @@ input[type="search"] { right: 0; bottom: 0; background-color: #ccc; - -webkit-transition: 0.4s; - transition: 0.4s; + transition: background-color 0.2s; border-radius: 1rem; } @@ -692,8 +696,7 @@ input[type="search"] { left: 2px; bottom: 2px; background-color: white; - -webkit-transition: 0.4s; - transition: 0.4s; + transition: transform 0.2s cubic-bezier(0.86, 0, 0.07, 1); border-radius: 50%; } @@ -705,10 +708,6 @@ input[type="search"] { background-color: #2196f3; } -.filter:focus + .slider { - box-shadow: 0 0 1px #2196f3; -} - .filter:checked + .slider:before { transform: translateX(calc(0.8rem)); }