aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-02-25 17:46:46 +0100
committerGitHub <noreply@github.com>2024-02-25 17:46:46 +0100
commitf4b92578b4601bc6e9b631b9a5a5f3766c27b0cb (patch)
tree909c2c984b94eb30504370e58360cd55136c4512 /web_src
parent4ccf5ab330c9ce8959aa6734c2e6fee282619ba5 (diff)
downloadgitea-f4b92578b4601bc6e9b631b9a5a5f3766c27b0cb.tar.gz
gitea-f4b92578b4601bc6e9b631b9a5a5f3766c27b0cb.zip
Add tailwindcss (#29357)
This will get tailwindcss working on a basic level. It provides only the utility classes, e.g. no tailwind base which we don't need because we have our own CSS reset. Without the base, we also do not have their CSS variables so a small amount of features do not work and I removed the generated classes for them. ***Note for future developers: This currently uses a `tw-` prefix, so we use it like `tw-p-3`.*** <details> <summary>Currently added CSS, all false-positives</summary> ``` .\!visible{ visibility: visible !important } .visible{ visibility: visible } .invisible{ visibility: hidden } .collapse{ visibility: collapse } .static{ position: static } .\!fixed{ position: fixed !important } .absolute{ position: absolute } .relative{ position: relative } .sticky{ position: sticky } .left-10{ left: 2.5rem } .isolate{ isolation: isolate } .float-right{ float: right } .float-left{ float: left } .mr-2{ margin-right: 0.5rem } .mr-3{ margin-right: 0.75rem } .\!block{ display: block !important } .block{ display: block } .inline-block{ display: inline-block } .inline{ display: inline } .flex{ display: flex } .inline-flex{ display: inline-flex } .\!table{ display: table !important } .inline-table{ display: inline-table } .table-caption{ display: table-caption } .table-cell{ display: table-cell } .table-column{ display: table-column } .table-column-group{ display: table-column-group } .table-footer-group{ display: table-footer-group } .table-header-group{ display: table-header-group } .table-row-group{ display: table-row-group } .table-row{ display: table-row } .flow-root{ display: flow-root } .inline-grid{ display: inline-grid } .contents{ display: contents } .list-item{ display: list-item } .\!hidden{ display: none !important } .hidden{ display: none } .flex-shrink{ flex-shrink: 1 } .shrink{ flex-shrink: 1 } .flex-grow{ flex-grow: 1 } .grow{ flex-grow: 1 } .border-collapse{ border-collapse: collapse } .select-all{ user-select: all } .resize{ resize: both } .flex-wrap{ flex-wrap: wrap } .overflow-visible{ overflow: visible } .rounded{ border-radius: 0.25rem } .border{ border-width: 1px } .text-justify{ text-align: justify } .uppercase{ text-transform: uppercase } .lowercase{ text-transform: lowercase } .capitalize{ text-transform: capitalize } .italic{ font-style: italic } .text-red{ color: var(--color-red) } .text-shadow{ color: var(--color-shadow) } .underline{ text-decoration-line: underline } .overline{ text-decoration-line: overline } .line-through{ text-decoration-line: line-through } .outline{ outline-style: solid } .ease-in{ transition-timing-function: cubic-bezier(0.4, 0, 1, 1) } .ease-in-out{ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) } .ease-out{ transition-timing-function: cubic-bezier(0, 0, 0.2, 1) } ``` </details> --------- Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/css/base.css8
-rw-r--r--web_src/css/index.css2
2 files changed, 10 insertions, 0 deletions
diff --git a/web_src/css/base.css b/web_src/css/base.css
index 76ecfc9bf5..280808a5ce 100644
--- a/web_src/css/base.css
+++ b/web_src/css/base.css
@@ -29,6 +29,14 @@
--fonts-regular: var(--fonts-override, var(--fonts-proportional)), "Noto Sans", "Liberation Sans", sans-serif, var(--fonts-emoji);
}
+*, ::before, ::after {
+ /* these are needed for tailwind borders to work because we do not load tailwind's base
+ https://github.com/tailwindlabs/tailwindcss/blob/master/src/css/preflight.css */
+ border-width: 0;
+ border-style: solid;
+ border-color: currentcolor;
+}
+
textarea {
font-family: var(--fonts-regular);
}
diff --git a/web_src/css/index.css b/web_src/css/index.css
index f893531b78..ab925a4aa0 100644
--- a/web_src/css/index.css
+++ b/web_src/css/index.css
@@ -59,4 +59,6 @@
@import "./explore.css";
@import "./review.css";
@import "./actions.css";
+
+@tailwind utilities;
@import "./helpers.css";