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

Use OKLCH notation for tailwind gradients #1082

Merged
Merged
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
56 changes: 56 additions & 0 deletions frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { join } from 'path';
import type { Config } from 'tailwindcss';
import plugin from 'tailwindcss/plugin';

// 1. Import the Skeleton plugin
import { skeleton } from '@skeletonlabs/tw-plugin';
Expand All @@ -25,6 +26,61 @@ const config = {
themes: {
custom: [cisoTheme]
}
}),
// Courtesy of bholmesdev: https://gist.github.com/bholmesdev/f326094e2097068c5de8f818f9aa8713
plugin(function spicyGradients({ addUtilities }) {
addUtilities({
'.bg-none': { 'background-image': 'none' },
'.bg-gradient-to-t': {
'background-image': 'linear-gradient(to top, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to top, black, white))': {
'background-image': 'linear-gradient(in oklch to top, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-b': {
'background-image': 'linear-gradient(to bottom, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to bottom, black, white))': {
'background-image': 'linear-gradient(in oklch to bottom, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-l': {
'background-image': 'linear-gradient(to left, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to left, black, white))': {
'background-image': 'linear-gradient(in oklch to left, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-r': {
'background-image': 'linear-gradient(to right, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to right, black, white))': {
'background-image': 'linear-gradient(in oklch to right, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-tl': {
'background-image': 'linear-gradient(to top left, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to top left, black, white))': {
'background-image': 'linear-gradient(in oklch to top left, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-tr': {
'background-image': 'linear-gradient(to top right, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to top right, black, white))': {
'background-image': 'linear-gradient(in oklch to top right, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-bl': {
'background-image': 'linear-gradient(to bottom left, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to bottom left, black, white))': {
'background-image': 'linear-gradient(in oklch to bottom left, var(--tw-gradient-stops))'
}
},
'.bg-gradient-to-br': {
'background-image': 'linear-gradient(to bottom right, var(--tw-gradient-stops))',
'@supports (background: linear-gradient(in oklch to bottom right, black, white))': {
'background-image':
'linear-gradient(in oklch to bottom right, var(--tw-gradient-stops))'
}
}
});
})
]
} satisfies Config;
Expand Down
Loading