feat: update to tailwind v4 (#35)

This commit is contained in:
kolaente
2025-03-02 20:21:54 +01:00
committed by GitHub
parent 003876fd8e
commit 96e62fd52d
26 changed files with 401 additions and 698 deletions
+6 -2
View File
@@ -1,17 +1,21 @@
import {defineConfig, envField} from 'astro/config'
import tailwind from '@astrojs/tailwind'
import markdoc from '@astrojs/markdoc'
import rehypeSlug from 'rehype-slug'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import sitemap from '@astrojs/sitemap'
import cloudflare from '@astrojs/cloudflare'
import tailwindcss from '@tailwindcss/vite'
// https://astro.build/config
export default defineConfig({
site: 'https://vikunja.io',
output: 'static',
vite: {
plugins: [
tailwindcss(),
],
},
integrations: [
tailwind(),
markdoc(),
sitemap(),
],
+2 -2
View File
@@ -18,16 +18,16 @@
"@astrojs/markdoc": "^0.12.10",
"@astrojs/node": "^9.1.2",
"@astrojs/sitemap": "^3.2.1",
"@astrojs/tailwind": "^5.1.5",
"@fontsource/open-sans": "^5.1.1",
"@fontsource/quicksand": "^5.1.1",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.0.9",
"astro": "^5.3.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"tailwindcss": "^3.4.17",
"tailwindcss": "^4.0.9",
"typescript": "^5.7.3"
},
"devDependencies": {
+302 -610
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -13,6 +13,8 @@ const {href, class: className, type} = Astro.props
}
<style>
@reference '../styles/global.css';
a, button {
@apply inline-flex relative justify-center items-center px-4 py-2 m-0 h-auto
text-sm font-bold text-center text-white uppercase
@@ -22,6 +24,6 @@ const {href, class: className, type} = Astro.props
leading-tight;
outline: none;
box-shadow: rgba(0, 0, 0, 0.05) 0 0 0 1px;
@apply hover:shadow-sm;
@apply hover:shadow-xs;
}
</style>
+6 -4
View File
@@ -10,14 +10,14 @@ function getClasses(): string {
let suffix = ''
switch (type) {
case 'info':
suffix = 'bg-primary-lighter !text-white'
suffix = 'bg-primary-lighter text-white!'
break
case 'warning':
suffix = 'bg-yellow-200 dark:bg-yellow-300 !text-gray-800'
suffix = 'bg-yellow-200 dark:bg-yellow-300 text-gray-800!'
break
}
return classNames + ' callout rounded px-4 py-3 ' + suffix
return classNames + ' callout rounded-sm px-4 py-3 ' + suffix
}
---
@@ -26,7 +26,9 @@ function getClasses(): string {
</div>
<style>
.callout :global(> p) {
@reference '../styles/global.css';
.callout :global(> p) {
@apply m-0;
}
</style>
+1 -1
View File
@@ -5,7 +5,7 @@ import SubscribeToNewsletter from './partials/SubscribeToNewsletter.astro'
const nowYear = (new Date()).getFullYear()
---
<footer
class="mx-auto mt-20 max-w-screen-xl border-t-2 border-gray-200 dark:border-gray-800 py-8 px-4 text-left text-sm text-gray-800 dark:text-gray-200 sm:flex sm:flex-wrap md:flex-nowrap"
class="mx-auto mt-20 max-w-(--breakpoint-xl) border-t-2 border-gray-200 dark:border-gray-800 py-8 px-4 text-left text-sm text-gray-800 dark:text-gray-200 sm:flex sm:flex-wrap md:flex-nowrap"
>
<div class="flex w-full flex-col md:w-2/5">
<LogoFull class="h-8 w-28"/>
+1 -1
View File
@@ -3,7 +3,7 @@ import LogoFull from './LogoFull.astro'
import Navigation from './Navigation.astro'
import HeaderGetStarted from './partials/HeaderGetStarted.astro'
---
<header class="flex mx-auto max-w-screen-xl pt-8 pb-4 px-8 items-center flex-col lg:flex-row justify-center lg:justify-between gap-4 lg:gap-1">
<header class="flex mx-auto max-w-(--breakpoint-xl) pt-8 pb-4 px-8 items-center flex-col lg:flex-row justify-center lg:justify-between gap-4 lg:gap-1">
<LogoFull class="block w-full h-full mx-20 sm:mx-0 sm:w-80 lg:h-12 lg:w-40"/>
<Navigation/>
+3 -1
View File
@@ -11,7 +11,7 @@ const {href, image, alt} = Astro.props
---
<a
href={href}
class="mt-4 h-40 w-full rounded overflow-hidden text-center font-display text-2xl font-bold text-white shadow relative"
class="mt-4 h-40 w-full rounded-sm overflow-hidden text-center font-display text-2xl font-bold text-white shadow-sm relative"
>
<Picture src={image} alt={alt}/>
<span class="py-16 px-8 z-10 absolute left-0 right-0">
@@ -20,6 +20,8 @@ const {href, image, alt} = Astro.props
</a>
<style>
@reference '../styles/global.css';
picture {
@apply w-full h-full flex absolute left-0 right-0 z-0;
+1 -1
View File
@@ -11,7 +11,7 @@ const isCurrentPage = href === '/'
: Astro.url.pathname.startsWith(href)
---
<li class={className}>
<a class={(isCurrentPage ? '!text-primary font-bold' : '') + ' py-2 px-4 rounded-md hover:bg-gray-700/5 dark:hover:bg-gray-300/5 hover:text-gray-950 dark:hover:text-gray-50 block transition relative'}
<a class={(isCurrentPage ? 'text-primary! font-bold' : '') + ' py-2 px-4 rounded-md hover:bg-gray-700/5 dark:hover:bg-gray-300/5 hover:text-gray-950 dark:hover:text-gray-50 block transition relative'}
href={href}>
<span class="absolute left-0 right-0 sm:text-center pl-4 sm:pl-0">
<slot/>
+1 -1
View File
@@ -1,3 +1,3 @@
<div class="prose dark:prose-invert max-w-none prose-headings:font-display prose-a:text-primary prose-a:no-underline hover:prose-a:underline prose-img:rounded-sm">
<div class="prose dark:prose-invert max-w-none prose-headings:font-display prose-a:text-primary prose-a:no-underline prose-a:hover:underline prose-img:rounded-xs">
<slot/>
</div>
+1 -1
View File
@@ -5,7 +5,7 @@ interface Props {
const {heading} = Astro.props
---
<div class="mt-32 mb-20 mx-auto max-w-screen-md">
<div class="mt-32 mb-20 mx-auto max-w-(--breakpoint-md)">
<h2 class="font-display text-3xl flex items-center justify-center text-balance">
<slot name="header-icon"/>
{heading}
@@ -8,7 +8,7 @@ import {VIKUNJA_CLOUD_LINK} from '../../helpers/vikunjaCloudLink'
Use the open-source version on your own server
</p>
<Button href="/docs/installing" class="!mt-4">
<Button href="/docs/installing" class="mt-4!">
Get Started
</Button>
</div>
@@ -22,7 +22,7 @@ import {VIKUNJA_CLOUD_LINK} from '../../helpers/vikunjaCloudLink'
Don't have a server or don't want to deal with it?
</p>
<Button href={VIKUNJA_CLOUD_LINK} class="!mt-4">
<Button href={VIKUNJA_CLOUD_LINK} class="mt-4!">
Meet Vikunja Cloud
</Button>
</div>
+1 -1
View File
@@ -6,7 +6,7 @@ interface Props {
const {showText} = Astro.props
---
<button class="flex items-center" data-toggle-dark-mode>
<button class="flex items-center cursor-pointer" data-toggle-dark-mode>
<svg class="size-6 text-gray-200 hidden dark:block" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256"><path d="M240,96a8,8,0,0,1-8,8H216v16a8,8,0,0,1-16,0V104H184a8,8,0,0,1,0-16h16V72a8,8,0,0,1,16,0V88h16A8,8,0,0,1,240,96ZM144,56h8v8a8,8,0,0,0,16,0V56h8a8,8,0,0,0,0-16h-8V32a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16Zm72.77,97a8,8,0,0,1,1.43,8A96,96,0,1,1,95.07,37.8a8,8,0,0,1,10.6,9.06A88.07,88.07,0,0,0,209.14,150.33,8,8,0,0,1,216.77,153Zm-19.39,14.88c-1.79.09-3.59.14-5.38.14A104.11,104.11,0,0,1,88,64c0-1.79,0-3.59.14-5.38A80,80,0,1,0,197.38,167.86Z"></path></svg>
<svg class="size-6 dark:hidden block" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256"><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"></path></svg>
{showText && <span class="ml-2">Toggle Dark Mode</span>}
+2 -2
View File
@@ -59,7 +59,7 @@ const plans: Plan[] = [
<div class="flex flex-col md:flex-row my-0 mx-auto md:space-x-4">
{plans.map((p: Plan) => (
<article class="border border-gray-50 dark:border-gray-900 rounded p-8 w-full md:w-1/3 bg-white dark:bg-gray-800 text-left mt-4 flex flex-col">
<article class="border border-gray-50 dark:border-gray-900 rounded-sm p-8 w-full md:w-1/3 bg-white dark:bg-gray-800 text-left mt-4 flex flex-col">
<div class="h-48 shrink-0 flex flex-col justify-between">
<div>
<div class="font-display text-xl mb-2">
@@ -101,7 +101,7 @@ const plans: Plan[] = [
</div>
</article>))}
<article class="border border-gray-50 dark:border-gray-900 rounded p-8 w-full md:w-1/3 bg-white dark:bg-gray-800 text-left mt-4 flex flex-col">
<article class="border border-gray-50 dark:border-gray-900 rounded-sm p-8 w-full md:w-1/3 bg-white dark:bg-gray-800 text-left mt-4 flex flex-col">
<div class="h-48 shrink-0 flex flex-col justify-between">
<div>
<div class="font-display text-xl mb-2">
@@ -8,7 +8,7 @@ import Button from '../Button.astro'
time.
</p>
<form method="post" action="" class="!mt-4 w-ful" id="newsletter-form">
<form method="post" action="" class="mt-4! w-ful" id="newsletter-form">
<p>
<label for="newsletter-email" class="sr-only">Your mail address</label>
<input
@@ -17,7 +17,7 @@ import Button from '../Button.astro'
type="email"
placeholder="Your mail address"
id="newsletter-email"
class="inline-flex relative justify-start items-center py-2 px-3 m-0 w-full max-w-full h-10 font-sans text-base leading-normal align-top bg-white dark:bg-gray-800 rounded border border-solid appearance-none cursor-text border-gray-300 dark:border-gray-700 text-neutral-700 dark:text-gray-200"
class="inline-flex relative justify-start items-center py-2 px-3 m-0 w-full max-w-full h-10 font-sans text-base leading-normal align-top bg-white dark:bg-gray-800 rounded-sm border border-solid appearance-none cursor-text border-gray-300 dark:border-gray-700 text-neutral-700 dark:text-gray-200"
/>
</p>
@@ -26,7 +26,7 @@ import Button from '../Button.astro'
<p id="newsletter-error-message" class="hidden text-red-500"></p>
<Button
class="!mt-2 w-full"
class="mt-2! w-full"
type="submit"
>
Subscribe to our newsletter
@@ -38,6 +38,8 @@ import Button from '../Button.astro'
</p>
<style>
@reference '../../styles/global.css';
.cf-turnstile {
@apply w-full mt-2
}
@@ -9,7 +9,7 @@ import Button from '../Button.astro'
</p>
<Button
class="!mt-2 w-full"
class="mt-2! w-full"
href="https://newsletter-subscribe.vikunja.io/"
>
Subscribe to our newsletter
+1 -1
View File
@@ -17,7 +17,7 @@ const description = Astro.props?.frontmatter?.description || Astro.props.descrip
---
<Layout title={title} type="text" image={image} description={description}>
<main class="mx-auto max-w-screen-lg">
<main class="mx-auto max-w-(--breakpoint-lg)">
<Prose>
<slot/>
</Prose>
+3 -3
View File
@@ -80,9 +80,9 @@ async function getSidebarNavigation(): Promise<DocumentationArray> {
const sidebarEntries = await getSidebarNavigation()
---
<Layout title={title} description={description}>
<div class="mx-auto flex max-w-screen-2xl flex-col lg:flex-row lg:pt-8">
<div class="mx-auto flex max-w-(--breakpoint-2xl) flex-col lg:flex-row lg:pt-8">
<button
class="navbar-burger m-2 mt-6 block lg:hidden rounded-sm bg-gray-200 dark:bg-gray-800 py-2 px-1 text-center"
class="navbar-burger m-2 mt-6 block lg:hidden rounded-xs bg-gray-200 dark:bg-gray-800 py-2 px-1 text-center"
data-target="docsMenu"
>
Toggle Menu
@@ -98,7 +98,7 @@ const sidebarEntries = await getSidebarNavigation()
<li>
<a
href={item.url}
class={'block rounded px-2 py-1.5 hover:bg-gray-200 dark:hover:bg-gray-800 transition ' + ((Astro.url.pathname === item.url || Astro.url.pathname === item.url + '/') && ' !bg-gray-100 dark:!bg-gray-800 text-primary')}
class={'block rounded-sm px-2 py-1.5 hover:bg-gray-200 dark:hover:bg-gray-800 transition ' + ((Astro.url.pathname === item.url || Astro.url.pathname === item.url + '/') && ' bg-gray-100! dark:bg-gray-800! text-primary')}
>
{item.title}
</a>
+1 -21
View File
@@ -5,6 +5,7 @@ import '@fontsource/open-sans/700-italic.css';
import '@fontsource/open-sans/700.css';
import '@fontsource/quicksand/400.css';
import '@fontsource/quicksand/700.css';
import '../styles/global.css'
import Footer from '../components/Footer.astro'
import Header from '../components/Header.astro'
@@ -75,27 +76,6 @@ const canonical = (new URL(Astro.url.pathname, Astro.site)).toString()
<Footer/>
<style is:global>
ul.list-checkmark {
list-style-type: '✓';
li::marker {
@apply text-blue-700 pr-2;
}
}
html.dark .astro-code,
html.dark .astro-code span {
color: var(--shiki-dark) !important;
background-color: var(--shiki-dark-bg) !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-dark-font-style) !important;
font-weight: var(--shiki-dark-font-weight) !important;
text-decoration: var(--shiki-dark-text-decoration) !important;
}
</style>
<script>
const buttons = document.querySelectorAll('[data-toggle-dark-mode]')
+1 -1
View File
@@ -20,7 +20,7 @@ const entries = await getChangelogEntries()
---
<Layout title="Changelog" description="Looking for the latest information about Vikunja's product development and releases? You've come to the right place!">
<div class="max-w-screen-md mx-auto mt-6">
<div class="max-w-(--breakpoint-md) mx-auto mt-6">
<h1 class="text-4xl font-display font-bold mb-6">Changelog</h1>
<p class="mb-8">Looking for the latest news about Vikunja's product development? You've come to the right place!</p>
{entries.map(e => (
+6 -6
View File
@@ -33,7 +33,7 @@ const {Content} = await post.render()
const description = post.data.description || Astro.props?.frontmatter?.description || Astro.props.description
---
<Layout title={post.data.title} description={description}>
<div class="flex flex-col lg:flex-row max-w-screen-lg mx-auto mt-6">
<div class="flex flex-col lg:flex-row max-w-(--breakpoint-lg) mx-auto mt-6">
<div class="w-full lg:w-1/5 pl-4 lg:pl-0 lg:pt-4">
<a href="/changelog" class="underline hover:text-primary flex items-center text-sm">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
@@ -51,7 +51,7 @@ const description = post.data.description || Astro.props?.frontmatter?.descripti
{newestRelease.id !== post.id &&
<Callout type="warning" class="mt-6">
There has been a <a href={'/changelog'+newestRelease.slug} class="!underline">new release</a> with additional fixes and
There has been a <a href={'/changelog'+newestRelease.slug} class="underline!">new release</a> with additional fixes and
improvements.
Updating is highly encouraged.
</Callout>
@@ -59,10 +59,10 @@ const description = post.data.description || Astro.props?.frontmatter?.descripti
<Callout type="info" class="mt-6">
If Vikunja is useful to you, please consider
<a href="https://www.buymeacoffee.com/kolaente" target="_blank" class="!text-white !underline">buying me a coffee</a>,
<a href="https://github.com/sponsors/kolaente" target="_blank" class="!text-white !underline">sponsoring me on GitHub</a>
or <a href="https://vikunja.io/stickers" class="!text-white !underline">buying a sticker pack</a>.
I'm also offering <a href="https://vikunja.cloud" class="!text-white !underline">a hosted version of
<a href="https://www.buymeacoffee.com/kolaente" target="_blank" class="text-white! underline!">buying me a coffee</a>,
<a href="https://github.com/sponsors/kolaente" target="_blank" class="text-white! underline!">sponsoring me on GitHub</a>
or <a href="https://vikunja.io/stickers" class="text-white! underline!">buying a sticker pack</a>.
I'm also offering <a href="https://vikunja.cloud" class="text-white! underline!">a hosted version of
Vikunja</a> if you want a hassle-free solution for yourself or your team.
</Callout>
+2 -2
View File
@@ -16,7 +16,7 @@ import CloudOrSelfHosted from '../components/partials/CloudOrSelfHosted.astro'
import Plans from '../components/partials/Plans.astro'
---
<Layout title="Features" description="Discover Vikunja, the open-source task management tool with powerful features. Stay organized, collaborate, and customize your workflow with multiple views.">
<main class="max-w-screen-xl mx-auto px-4 md:px-0 text-center">
<main class="max-w-(--breakpoint-xl) mx-auto px-4 md:px-0 text-center">
<div class="pt-32 pb-8 px-4">
<h1 class="text-3xl font-display">
Think of Vikunja like the notebook you have with all your things to keep track of.
@@ -81,7 +81,7 @@ import Plans from '../components/partials/Plans.astro'
And if you are a developer and know your way around Go or Vue.js, any help is appreciated.
</FeatureCenter>
<div class="shadow-lg rounded mb-16">
<div class="shadow-lg rounded-sm mb-16">
<Picture
src={VikunjaTaskOverview}
formats={['avif', 'webp']}
+2
View File
@@ -221,6 +221,8 @@ const carouselImages = [
</Layout>
<style>
@reference '../styles/global.css';
.slider picture {
@apply absolute left-0 top-0 right-0 w-full object-contain object-top shadow-lg transition-all duration-300 ease-in-out;
}
+1 -1
View File
@@ -31,7 +31,7 @@ and their [ISO/IEC 27001 certification](https://www.hetzner.com/unternehmen/zert
## Reporting a security vulnerability
<span class="text-gray-500">
Based on <a class="!underline !text-gray-500" href="https://supabase.com/.well-known/security.txt">https://supabase.com/.well-known/security.txt</a>.
Based on <a class="underline! text-gray-500!" href="https://supabase.com/.well-known/security.txt">https://supabase.com/.well-known/security.txt</a>.
</span>
At Vikunja, we consider the security of the product and our systems a top priority. But no matter how much effort we put
+46
View File
@@ -0,0 +1,46 @@
@import 'tailwindcss';
@config '../../tailwind.config.mjs';
@plugin '@tailwindcss/typography';
@plugin '@tailwindcss/forms';
@plugin '@tailwindcss/aspect-ratio';
@theme {
--color-primary-lighter: #3780ff;
--color-primary: #196aff;
--color-primary-darker: #0064ff;
--font-display: 'Quicksand', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-sans: 'Open Sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
}
@custom-variant dark (&:where(.dark, .dark *));
ul.list-checkmark {
list-style-type: '✓';
li::marker {
@apply text-blue-700 pr-2;
}
}
html.dark .astro-code,
html.dark .astro-code span {
color: var(--shiki-dark) !important;
background-color: var(--shiki-dark-bg) !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-dark-font-style) !important;
font-weight: var(--shiki-dark-font-weight) !important;
text-decoration: var(--shiki-dark-text-decoration) !important;
}
-29
View File
@@ -1,31 +1,7 @@
const defaultTheme = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}',
'astro.config.mjs',
],
darkMode: 'selector',
theme: {
extend: {
colors: {
primary: {
lighter: '#3780ff',
DEFAULT: '#196aff',
darker: '#0064ff',
},
},
fontFamily: {
display: ['Quicksand', ...defaultTheme.fontFamily.sans],
sans: ['Open Sans', ...defaultTheme.fontFamily.sans],
},
backgroundImage: {
'hero-llama': "url('/images/bg-3.jpg')",
'hero-llama-small': "url('/images/hero-llamas-small.jpg')",
'hero-llama-2-small': "url('/images/hero-llamas-2-small.jpg')",
'hero-llama-3-small': "url('/images/hero-llamas-3-small.jpg')",
},
typography: ({ theme }) => ({
DEFAULT: {
css: {
@@ -51,9 +27,4 @@ export default {
},
},
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/forms'),
require('@tailwindcss/aspect-ratio'),
],
}