mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 08:41:19 -04:00
chore: migrate to Tailwind CSS v4.0 (#632)
* chore: migrate PostCSS configuration to v4 * chore: update dependencies in package.json and package-lock.json - Bump versions for autoprefixer, postcss, postcss-cli, prettier, and tailwindcss. - Remove unused dependencies to streamline the project. * chore: add @tailwindcss/postcss and update package-lock.json * fix: update import paths in CSS files for consistency * fix: change prefix from `hx-` to `hx:` * chore: migrate primary color theme variables to CSS * fix: remove unnecessary text decoration property from anchor styles in typography CSS * fix: update CSS styles for improved consistency and clarity across components * chore: clean up package.json and package-lock.json, remove unused dependencies, and update CSS imports for better organization * fix: bulk replace prefix `hx-` with `hx:` * fix: update tailwind css prefix * fix: styling consistent issues - steps counter fix in v4 - removed tailwind.css - update hr border colors - fix button cursor in v4 - fix border colors in various places * fix: update class prefixes for consistency in menu and sidebar components * fix: refine CSS classes and transitions for navbar and sidebar components - Updated hamburger menu styles for improved animation and structure. - Adjusted sidebar transition duration for smoother effects. - Standardized class prefixes for consistency across components. * fix: update border color in hero badge component for improved styling consistency * fix: update tab button cursor style for improved user interaction * chore: recompile css * fix: dark mode color not applied for before / after elements * fix: docs navigation * chore: recompile CSS * chore: update Tailwind CSS and PostCSS dependencies to version 4.0.17, recompile CSS, and add safelist * fix: typo in class name and add back decoration-from-font for typography a tags * fix: update class syntax for Tailwind CSS compatibility in mermaid code block
This commit is contained in:
@ -4,12 +4,12 @@
|
||||
{{- $copyCode := (T "copyCode") | default "Copy code" -}}
|
||||
|
||||
|
||||
<div class="hextra-code-copy-btn-container {{ if eq $display `hover` }}hx-opacity-0{{ end }} hx-transition group-hover/code:hx-opacity-100 hx-flex hx-gap-1 hx-absolute hx-m-[11px] hx-right-0 {{ if $filename }}hx-top-8{{ else }}hx-top-0{{ end }}">
|
||||
<div class="hextra-code-copy-btn-container {{ if eq $display `hover` }}hx:opacity-0{{ end }} hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 {{ if $filename }}hx:top-8{{ else }}hx:top-0{{ end }}">
|
||||
<button
|
||||
class="hextra-code-copy-btn hx-group/copybtn hx-transition-all active:hx-opacity-50 hx-bg-primary-700/5 hx-border hx-border-black/5 hx-text-gray-600 hover:hx-text-gray-900 hx-rounded-md hx-p-1.5 dark:hx-bg-primary-300/10 dark:hx-border-white/10 dark:hx-text-gray-400 dark:hover:hx-text-gray-50"
|
||||
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
|
||||
title="{{ $copyCode }}"
|
||||
>
|
||||
<div class="copy-icon group-[.copied]/copybtn:hx-hidden hx-pointer-events-none hx-h-4 hx-w-4"></div>
|
||||
<div class="success-icon hx-hidden group-[.copied]/copybtn:hx-block hx-pointer-events-none hx-h-4 hx-w-4"></div>
|
||||
<div class="copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
|
||||
<div class="success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
{{- $filename = strings.TrimPrefix "/" $filename -}}
|
||||
{{- $file_url := urls.JoinPath $base_url $filename -}}
|
||||
|
||||
<a class="hx-no-underline hx-inline-flex hx-items-center hx-gap-1" href="{{ $file_url }}" target="_blank" rel="noopener noreferrer">
|
||||
<a class="hx:no-underline hx:inline-flex hx:items-center hx:gap-1" href="{{ $file_url }}" target="_blank" rel="noopener noreferrer">
|
||||
<span>{{- $filename -}}</span>
|
||||
{{- partial "utils/icon" (dict "name" "external-link" "attributes" "height=1em") -}}
|
||||
</a>
|
||||
|
@ -13,29 +13,29 @@
|
||||
{{- $icon := index $icons $alertType -}}
|
||||
{{- $title := or $alertTitle (or (i18n $alertType) (title $alertType)) -}}
|
||||
|
||||
{{- $defaultClass := "hx-border-orange-100 hx-bg-orange-50 hx-text-orange-800 dark:hx-border-orange-400/30 dark:hx-bg-orange-400/20 dark:hx-text-orange-300" }}
|
||||
{{- $defaultClass := "hx:border-orange-100 hx:bg-orange-50 hx:text-orange-800 hx:dark:border-orange-400/30 hx:dark:bg-orange-400/20 hx:dark:text-orange-300" }}
|
||||
|
||||
{{- $alertClasses := dict
|
||||
"note" "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200"
|
||||
"tip" "hx-border-green-200 hx-bg-green-100 hx-text-green-900 dark:hx-border-green-200/30 dark:hx-bg-green-900/30 dark:hx-text-green-200"
|
||||
"important" "hx-border-indigo-200 hx-bg-indigo-100 hx-text-indigo-900 dark:hx-border-indigo-200/30 dark:hx-bg-indigo-900/30 dark:hx-text-indigo-200"
|
||||
"warning" "hx-border-amber-200 hx-bg-amber-100 hx-text-amber-900 dark:hx-border-amber-200/30 dark:hx-bg-amber-900/30 dark:hx-text-amber-200"
|
||||
"caution" "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200"
|
||||
"note" "hx:border-blue-200 hx:bg-blue-100 hx:text-blue-900 hx:dark:border-blue-200/30 hx:dark:bg-blue-900/30 hx:dark:text-blue-200"
|
||||
"tip" "hx:border-green-200 hx:bg-green-100 hx:text-green-900 hx:dark:border-green-200/30 hx:dark:bg-green-900/30 hx:dark:text-green-200"
|
||||
"important" "hx:border-indigo-200 hx:bg-indigo-100 hx:text-indigo-900 hx:dark:border-indigo-200/30 hx:dark:bg-indigo-900/30 hx:dark:text-indigo-200"
|
||||
"warning" "hx:border-amber-200 hx:bg-amber-100 hx:text-amber-900 hx:dark:border-amber-200/30 hx:dark:bg-amber-900/30 hx:dark:text-amber-200"
|
||||
"caution" "hx:border-red-200 hx:bg-red-100 hx:text-red-900 hx:dark:border-red-200/30 hx:dark:bg-red-900/30 hx:dark:text-red-200"
|
||||
-}}
|
||||
|
||||
{{- $class := index $alertClasses $alertType | default $defaultClass -}}
|
||||
|
||||
|
||||
<div class="hx-overflow-x-auto hx-mt-6 hx-flex hx-flex-col hx-rounded-lg hx-border hx-py-4 hx-px-4 contrast-more:hx-border-current contrast-more:dark:hx-border-current {{ $class }}">
|
||||
<p class="hx-flex hx-items-center hx-font-medium">
|
||||
<div class="hx:overflow-x-auto hx:mt-6 hx:flex hx:flex-col hx:rounded-lg hx:border hx:py-4 hx:px-4 hx:border-gray-200 hx:contrast-more:border-current hx:contrast-more:dark:border-current {{ $class }}">
|
||||
<p class="hx:flex hx:items-center hx:font-medium">
|
||||
{{- with $icon -}}
|
||||
{{- partial "utils/icon.html" (dict "name" . "attributes" `height=16px class="hx-inline-block hx-align-middle hx-mr-2"`) -}}
|
||||
{{- partial "utils/icon.html" (dict "name" . "attributes" `height=16px class="hx:inline-block hx:align-middle hx:mr-2"`) -}}
|
||||
{{- end -}}
|
||||
{{- $title -}}
|
||||
</p>
|
||||
|
||||
<div class="hx-w-full hx-min-w-0 hx-leading-7">
|
||||
<div class="hx-mt-6 hx-leading-7 first:hx-mt-0">
|
||||
<div class="hx:w-full hx:min-w-0 hx:leading-7">
|
||||
<div class="hx:mt-6 hx:leading-7 hx:first:mt-0">
|
||||
{{- $content -}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,10 +3,10 @@
|
||||
{{- if site.Params.displayUpdatedDate -}}
|
||||
{{- with .Lastmod -}}
|
||||
{{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .) }}
|
||||
<div class="hx-mt-12 hx-mb-8 hx-block hx-text-xs hx-text-gray-500 ltr:hx-text-right rtl:hx-text-left dark:hx-text-gray-400">{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
|
||||
<div class="hx:mt-12 hx:mb-8 hx:block hx:text-xs hx:text-gray-500 hx:ltr:text-right hx:rtl:text-left hx:dark:text-gray-400">{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
|
||||
{{- else -}}
|
||||
<div class="hx-mt-16"></div>
|
||||
<div class="hx:mt-16"></div>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<div class="hx-mt-16"></div>
|
||||
<div class="hx:mt-16"></div>
|
||||
{{- end -}}
|
||||
|
@ -26,15 +26,15 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- if or $prev $next -}}
|
||||
<div class="hx-mb-8 hx-flex hx-items-center hx-border-t hx-pt-8 dark:hx-border-neutral-800 contrast-more:hx-border-neutral-400 dark:contrast-more:hx-border-neutral-400 print:hx-hidden">
|
||||
<div class="hx:mb-8 hx:flex hx:items-center hx:border-t hx:pt-8 hx:border-gray-200 hx:dark:border-neutral-800 hx:contrast-more:border-neutral-400 hx:dark:contrast-more:border-neutral-400 hx:print:hidden">
|
||||
{{- if $prev -}}
|
||||
{{- $linkTitle := partial "utils/title" $prev -}}
|
||||
<a
|
||||
href="{{ $prev.RelPermalink }}"
|
||||
title="{{ $linkTitle }}"
|
||||
class="hx-flex hx-max-w-[50%] hx-items-center hx-gap-1 hx-py-4 hx-text-base hx-font-medium hx-text-gray-600 hx-transition-colors [word-break:break-word] hover:hx-text-primary-600 dark:hx-text-gray-300 md:hx-text-lg ltr:hx-pr-4 rtl:hx-pl-4"
|
||||
class="hx:flex hx:max-w-[50%] hx:items-center hx:gap-1 hx:py-4 hx:text-base hx:font-medium hx:text-gray-600 hx:transition-colors [word-break:break-word] hx:hover:text-primary-600 hx:dark:text-gray-300 hx:md:text-lg hx:ltr:pr-4 hx:rtl:pl-4"
|
||||
>
|
||||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx-inline hx-h-5 hx-shrink-0 ltr:hx-rotate-180\"") -}}
|
||||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx:inline hx:h-5 hx:shrink-0 hx:ltr:rotate-180\"") -}}
|
||||
{{- $linkTitle -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
@ -43,10 +43,10 @@
|
||||
<a
|
||||
href="{{ $next.RelPermalink }}"
|
||||
title="{{ $linkTitle }}"
|
||||
class="hx-flex hx-max-w-[50%] hx-items-center hx-gap-1 hx-py-4 hx-text-base hx-font-medium hx-text-gray-600 hx-transition-colors [word-break:break-word] hover:hx-text-primary-600 dark:hx-text-gray-300 md:hx-text-lg ltr:hx-ml-auto ltr:hx-pl-4 ltr:hx-text-right rtl:hx-mr-auto rtl:hx-pr-4 rtl:hx-text-left"
|
||||
class="hx:flex hx:max-w-[50%] hx:items-center hx:gap-1 hx:py-4 hx:text-base hx:font-medium hx:text-gray-600 hx:transition-colors [word-break:break-word] hx:hover:text-primary-600 hx:dark:text-gray-300 hx:md:text-lg hx:ltr:ml-auto hx:ltr:pl-4 hx:ltr:text-right hx:rtl:mr-auto hx:rtl:pr-4 hx:rtl:text-left"
|
||||
>
|
||||
{{- $linkTitle -}}
|
||||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx-inline hx-h-5 hx-shrink-0 rtl:-hx-rotate-180\"") -}}
|
||||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx:inline hx:h-5 hx:shrink-0 hx:rtl:-rotate-180\"") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user