Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Use color transitions for outlines #1

Merged
merged 2 commits into from
Aug 4, 2023
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: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ updates:
directory: "/"
schedule:
interval: monthly
- package-ecosystem: "github-actions"
directory: "/examples/"
schedule:
interval: monthly
4 changes: 2 additions & 2 deletions examples/dist/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,8 @@ video {
outline-width: 0px;
}

.transition-all {
transition-property: all;
.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, outline-color;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
Expand Down
6 changes: 3 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="font-bold text-lg mb-2">
Button example
</h2>
<div class="mb-4">
<button type="button" class="bg-blue-600 px-4 py-2 text-bg-contrast hover:-bg-lightness-offset-10 rounded transition-all focus:outline-4 outline-0 outline outline-bg/40 font-medium">
<button type="button" class="bg-blue-600 px-4 py-2 text-bg-contrast hover:-bg-lightness-offset-10 rounded transition-colors focus:outline-4 outline-0 outline outline-bg/40 font-medium">
Button
</button>
</div>
Expand All @@ -43,7 +43,7 @@ <h2 class="font-bold text-lg mb-2">
Button with changing colors example
</h2>
<div class="mb-4">
<button type="button" class="bg-blue-600 px-4 py-2 text-bg-contrast hover:bg-blue-400 rounded transition-all focus:outline-4 outline-0 outline outline-bg/40 font-medium">
<button type="button" class="bg-blue-600 px-4 py-2 text-bg-contrast hover:bg-blue-400 rounded transition-colors focus:outline-4 outline-0 outline outline-bg/40 font-medium">
Button
</button>
</div>
Expand Down Expand Up @@ -100,7 +100,7 @@ <h2 class="font-bold text-lg mb-2">
Named colors example
</h2>
<div class="flex items-center gap-3 mb-4">
<button type="button" class="bg-primary px-4 py-2 text-bg-contrast hover:-bg-lightness-offset-10 rounded transition-all focus:outline-4 outline-0 outline outline-bg/40 font-medium">
<button type="button" class="bg-primary px-4 py-2 text-bg-contrast hover:-bg-lightness-offset-10 rounded transition-colors focus:outline-4 outline-0 outline outline-bg/40 font-medium">
Button
</button>
<label class="flex items-center font-bold cursor-pointer hover:bg-lightness-offset-10">
Expand Down
3 changes: 0 additions & 3 deletions examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"license": "ISC",
"devDependencies": {
"tailwindcss": "^3.3.3"
},
"dependencies": {
"tailwindcss-oklch": "^0.0.0-alpha"
}
}
9 changes: 8 additions & 1 deletion examples/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/** @type {import('tailwindcss').Config} */

const defaultTheme = require('tailwindcss/defaultTheme');

module.exports = {
content: ["index.html"],
plugins: [require('tailwindcss-oklch')({
plugins: [require('./../index.js')({
contrastThreshold: .6,
})],
theme: {
Expand All @@ -10,6 +13,10 @@ module.exports = {
primary: `oklch(var(--color-primary-l) var(--color-primary-c) var(--color-primary-h) / <alpha-value>)`,
body: `oklch(var(--color-body-l) var(--color-body-c) var(--color-body-h) / <alpha-value>)`,
},
transitionProperty: {
DEFAULT: `${defaultTheme.transitionProperty.DEFAULT}, outline-color`,
colors: `${defaultTheme.transitionProperty.colors}, outline-color`,
}
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.