Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme preview typo and focus styles #16

Merged
merged 2 commits into from
Dec 17, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/components/navigation/create-theme-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ export function CreateThemeForm({
<p className="prose w-full border-2 border-primary p-3 text-primary">
<span className="correct">The L</span>
<span className="incorrect">o</span>
<span className="correct">rd is my</span>
<span className="extra">Sheppard</span>
<span className="correct">rd is my</span>{' '}
<span className="extra">Shepherd</span>
<span> I shall not want.</span>
</p>
</div>
Expand Down
46 changes: 16 additions & 30 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@ body[style] {
}

/* focus-within is required because inputs have no content, and `:before` is prepended to content.*/
.svg-outline:focus-within *,
.svg-outline:focus,
.svg-outline-sm:focus-within *,
.svg-outline-sm:focus {
.svg-outline-sm:focus,
.svg-outline-within:focus-within * {
@apply outline-none;
}

.svg-outline-within:focus-within:before {
@apply -inset-2;
content: ' ';
background-color: oklch(var(--color-primary));
-webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" %3E%3Crect x="0" y="0" width="100%25" height="100%25" stroke-width="4" stroke="black" fill="transparent" stroke-dasharray="6 5" /%3E%3C/svg%3E');
mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" %3E%3Crect x="0" y="0" width="100%25" height="100%25" stroke-width="4" stroke="black" fill="transparent" stroke-dasharray="6 5" /%3E%3C/svg%3E');
position: absolute;
}

.svg-outline-override,
.svg-outline:focus:before,
.svg-outline:focus-within:before,
.svg-outline-sm:focus:before,
.svg-outline-sm:focus-within:before,
.svg-outline-xs:focus:before,
.svg-outline-xs:focus-within:before,
.svg-outline-stubby:focus:before,
.svg-outline-stubby:focus-within:before {
.svg-outline-stubby:focus:before {
@apply -inset-2;
content: ' ';
background-color: oklch(var(--color-primary));
Expand All @@ -38,40 +43,21 @@ body[style] {
position: absolute;
}

.svg-outline-sm:focus:before,
.svg-outline-sm:focus-within:before {
.svg-outline-sm:focus:before {
@apply -inset-1;
}

.svg-outline-xs:focus:before,
.svg-outline-xs:focus-within:before {
.svg-outline-xs:focus:before {
@apply inset-0;
}

.svg-outline-stubby:focus:before,
.svg-outline-stubby:focus-within:before {
.svg-outline-stubby:focus:before {
@apply -bottom-0.5 -left-3 -right-3 -top-0.5;

background-color: oklch(var(--color-primary));
-webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" %3E%3Crect x="0" y="0" width="100%25" height="100%25" stroke-width="4" stroke="var(--color-primary)" fill="transparent" stroke-dasharray="6 5" /%3E%3C/svg%3E');
mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" %3E%3Crect x="0" y="0" width="100%25" height="100%25" stroke-width="4" stroke="black" fill="transparent" stroke-dasharray="6 5" /%3E%3C/svg%3E');
}

@media (prefers-color-scheme: dark) {
.svg-outline:focus:before,
.svg-outline:focus-within:before,
.svg-outline-sm:focus:before,
.svg-outline-sm:focus-within:before,
.svg-outline-xs:focus:before,
.svg-outline-xs:focus-within:before,
.svg-outline-stubby:focus:before,
.svg-outline-stubby:focus-within:before {
background-color: oklch(var(--color-primary));
-webkit-mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" %3E%3Crect x="0" y="0" width="100%25" height="100%25" stroke-width="4" stroke="black" fill="transparent" stroke-dasharray="6 5" /%3E%3C/svg%3E');
mask-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" %3E%3Crect x="0" y="0" width="100%25" height="100%25" stroke-width="4" stroke="black" fill="transparent" stroke-dasharray="6 5" /%3E%3C/svg%3E');
}
}

.hazard {
border-image: repeating-linear-gradient(
-80deg,
Expand Down