Skip to content

Commit

Permalink
perf: accessibility improved
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx committed Aug 1, 2024
1 parent 0c60c45 commit 4fdf502
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
16 changes: 14 additions & 2 deletions components/daisy/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@ export default function Toggle(props: Props) {
? (
<label className="label cursor-pointer">
<span className="label-text">{label}</span>
<input type="checkbox" className="toggle" checked={checked} />
<input
aria-label="toggle button"
type="checkbox"
className="toggle"
checked={checked}
/>
</label>
)
: <input type="checkbox" className="toggle" checked={checked} />}
: (
<input
aria-label="toggle button"
type="checkbox"
className="toggle"
checked={checked}
/>
)}
</div>
);
}
6 changes: 5 additions & 1 deletion components/footer/FooterItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ export default function FooterItems(
{sections.map((section) => (
<li>
<div class="collapse collapse-arrow">
<input type="checkbox" class="min-h-[0]" />
<input
aria-label="open collapse"
type="checkbox"
class="min-h-[0]"
/>
<label
htmlFor={section.label}
class="collapse-title min-h-[0] !px-0 flex gap-2"
Expand Down
2 changes: 1 addition & 1 deletion components/header/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface Props {
function MenuItem({ item }: { item: SiteNavigationElement }) {
return (
<div class="collapse collapse-arrow">
<input type="checkbox" />
<input aria-label="toggle menu" type="checkbox" />
<div class="collapse-title">
<div class="flex items-center gap-2 w-full">
<Icon
Expand Down
1 change: 1 addition & 0 deletions components/layout/CategoriesShelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function CategoryCard({ image, label, callToAction }: Category) {
<div class="flex flex-col items-center justify-between w-full h-[294px]">
<Image
src={image}
alt={label}
width={204}
height={204}
loading="lazy"
Expand Down
6 changes: 5 additions & 1 deletion sections/Content/Brands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export default function Brands(
index={index}
class="carousel-item w-40 h-full"
>
<a href={brand.link} class="border-2 border-gray-300 w-full">
<a
aria-label={`go to ${brand.description}`}
href={brand.link}
class="border-2 border-gray-300 w-full"
>
<Image
src={brand.image}
width={160 || brand.width}
Expand Down

0 comments on commit 4fdf502

Please sign in to comment.