diff options
author | silverwind <me@silverwind.io> | 2024-03-18 15:47:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 14:47:05 +0000 |
commit | 34290a00c4501ffeba26db267be71ab68e3ec97f (patch) | |
tree | 8d534caf068098c911423481977c60dbce146f98 /web_src | |
parent | b251e608c01392c947f84be387f956541bfea25c (diff) | |
download | gitea-34290a00c4501ffeba26db267be71ab68e3ec97f.tar.gz gitea-34290a00c4501ffeba26db267be71ab68e3ec97f.zip |
Migrate border and margin classes to Tailwind (#29828)
Used all existing css vars, other migrations are 1:1.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/css/helpers.css | 22 | ||||
-rw-r--r-- | web_src/js/components/DashboardRepoList.vue | 9 | ||||
-rw-r--r-- | web_src/js/components/DiffCommitSelector.vue | 14 | ||||
-rw-r--r-- | web_src/js/components/RepoCodeFrequency.vue | 2 | ||||
-rw-r--r-- | web_src/js/components/RepoContributors.vue | 2 | ||||
-rw-r--r-- | web_src/js/components/RepoRecentCommits.vue | 2 | ||||
-rw-r--r-- | web_src/js/features/repo-diff-commit.js | 2 |
7 files changed, 18 insertions, 35 deletions
diff --git a/web_src/css/helpers.css b/web_src/css/helpers.css index 860722823a..6fc84d743c 100644 --- a/web_src/css/helpers.css +++ b/web_src/css/helpers.css @@ -52,18 +52,6 @@ Gitea's private styles use `g-` prefix. .gt-font-semibold { font-weight: var(--font-weight-semibold) !important; } .gt-font-bold { font-weight: var(--font-weight-bold) !important; } -.gt-rounded { border-radius: var(--border-radius) !important; } -.gt-rounded-top { border-radius: var(--border-radius) var(--border-radius) 0 0 !important; } -.gt-rounded-bottom { border-radius: 0 0 var(--border-radius) var(--border-radius) !important; } -.gt-rounded-left { border-radius: var(--border-radius) 0 0 var(--border-radius) !important; } -.gt-rounded-right { border-radius: 0 var(--border-radius) var(--border-radius) 0 !important; } - -.gt-border-secondary { border: 1px solid var(--color-secondary) !important; } -.gt-border-secondary-top { border-top: 1px solid var(--color-secondary) !important; } -.gt-border-secondary-bottom { border-bottom: 1px solid var(--color-secondary) !important; } -.gt-border-secondary-left { border-left: 1px solid var(--color-secondary) !important; } -.gt-border-secondary-right { border-right: 1px solid var(--color-secondary) !important; } - .interact-fg { color: inherit !important; } .interact-fg:hover { color: var(--color-primary) !important; } .interact-fg:active { color: var(--color-primary-active) !important; } @@ -121,14 +109,6 @@ Gitea's private styles use `g-` prefix. .gt-my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; } .gt-my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; } -.gt-m-auto { margin: auto !important; } -.gt-mx-auto { margin-left: auto !important; margin-right: auto !important; } -.gt-my-auto { margin-top: auto !important; margin-bottom: auto !important; } -.gt-mt-auto { margin-top: auto !important; } -.gt-mr-auto { margin-right: auto !important; } -.gt-mb-auto { margin-bottom: auto !important; } -.gt-ml-auto { margin-left: auto !important; } - .gt-p-0 { padding: 0 !important; } .gt-p-1 { padding: .125rem !important; } .gt-p-2 { padding: .25rem !important; } @@ -199,8 +179,6 @@ Gitea's private styles use `g-` prefix. .gt-gap-y-4 { row-gap: 1rem !important; } .gt-gap-y-5 { row-gap: 2rem !important; } -.gt-shrink-0 { flex-shrink: 0 !important; } - .gt-font-12 { font-size: 12px !important } .gt-font-13 { font-size: 13px !important } .gt-font-14 { font-size: 14px !important } diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index e039ed016b..177ae04855 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -409,7 +409,7 @@ export default sfc; // activate the IDE's Vue plugin </div> </overflow-menu> </div> - <div v-if="repos.length" class="ui attached table segment gt-rounded-bottom"> + <div v-if="repos.length" class="ui attached table segment tw-rounded-b"> <ul class="repo-owner-name-list"> <li class="gt-df gt-ac gt-py-3" v-for="repo, index in repos" :class="{'active': index === activeIndex}" :key="repo.id"> <a class="repo-list-link muted" :href="repo.link"> @@ -425,8 +425,9 @@ export default sfc; // activate the IDE's Vue plugin </a> </li> </ul> - <div v-if="showMoreReposLink" class="center gt-py-3 gt-border-secondary-top"> - <div class="ui borderless pagination menu narrow"> + <div v-if="showMoreReposLink" class="tw-text-center"> + <div class="divider gt-my-0"/> + <div class="ui borderless pagination menu narrow gt-my-3"> <a class="item navigation gt-py-2" :class="{'disabled': page === 1}" @click="changePage(1)" :title="textFirstPage" @@ -466,7 +467,7 @@ export default sfc; // activate the IDE's Vue plugin <svg-icon name="octicon-plus"/> </a> </h4> - <div v-if="organizations.length" class="ui attached table segment gt-rounded-bottom"> + <div v-if="organizations.length" class="ui attached table segment tw-rounded-b"> <ul class="repo-owner-name-list"> <li class="gt-df gt-ac gt-py-3" v-for="org in organizations" :key="org.name"> <a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)"> diff --git a/web_src/js/components/DiffCommitSelector.vue b/web_src/js/components/DiffCommitSelector.vue index 780ba22f0c..b465127aca 100644 --- a/web_src/js/components/DiffCommitSelector.vue +++ b/web_src/js/components/DiffCommitSelector.vue @@ -204,7 +204,7 @@ export default { </button> <div class="menu left transition" id="diff-commit-selector-menu" :class="{visible: menuVisible}" v-show="menuVisible" v-cloak :aria-expanded="menuVisible ? 'true': 'false'"> <div class="loading-indicator is-loading" v-if="isLoading"/> - <div v-if="!isLoading" class="vertical item gt-df gt-fc gt-gap-2" id="diff-commit-list-show-all" role="menuitem" @keydown.enter="showAllChanges()" @click="showAllChanges()"> + <div v-if="!isLoading" class="vertical item" id="diff-commit-list-show-all" role="menuitem" @keydown.enter="showAllChanges()" @click="showAllChanges()"> <div class="gt-ellipsis"> {{ locale.show_all_commits }} </div> @@ -215,7 +215,7 @@ export default { <!-- only show the show changes since last review if there is a review AND we are commits ahead of the last review --> <div v-if="lastReviewCommitSha != null" role="menuitem" - class="vertical item gt-df gt-fc gt-gap-2 gt-border-secondary-top" + class="vertical item" :class="{disabled: commitsSinceLastReview === 0}" @keydown.enter="changesSinceLastReviewClick()" @click="changesSinceLastReviewClick()" @@ -227,10 +227,10 @@ export default { {{ commitsSinceLastReview }} commits </div> </div> - <span v-if="!isLoading" class="info gt-border-secondary-top text light-2">{{ locale.select_commit_hold_shift_for_range }}</span> + <span v-if="!isLoading" class="info text light-2">{{ locale.select_commit_hold_shift_for_range }}</span> <template v-for="commit in commits" :key="commit.id"> <div - class="vertical item gt-df gt-gap-2 gt-border-secondary-top" role="menuitem" + class="vertical item" role="menuitem" :class="{selection: commit.selected, hovered: commit.hovered}" @keydown.enter.exact="commitClicked(commit.id)" @keydown.enter.shift.exact="commitClickedShift(commit)" @@ -285,10 +285,14 @@ export default { width: 350px; } - #diff-commit-selector-menu .item { + #diff-commit-selector-menu .item, + #diff-commit-selector-menu .info { + display: flex !important; flex-direction: row; line-height: 1.4; padding: 7px 14px !important; + border-top: 1px solid var(--color-secondary) !important; + gap: 0.25em; } #diff-commit-selector-menu .item:focus { diff --git a/web_src/js/components/RepoCodeFrequency.vue b/web_src/js/components/RepoCodeFrequency.vue index ad607a041a..c55bbff9cd 100644 --- a/web_src/js/components/RepoCodeFrequency.vue +++ b/web_src/js/components/RepoCodeFrequency.vue @@ -148,7 +148,7 @@ export default { {{ isLoading ? locale.loadingTitle : errorText ? locale.loadingTitleFailed: `Code frequency over the history of ${repoLink.slice(1)}` }} </div> <div class="gt-df ui segment main-graph"> - <div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto"> + <div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto"> <div v-if="isLoading"> <SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/> {{ locale.loadingInfo }} diff --git a/web_src/js/components/RepoContributors.vue b/web_src/js/components/RepoContributors.vue index 22c247ae32..6093c762cb 100644 --- a/web_src/js/components/RepoContributors.vue +++ b/web_src/js/components/RepoContributors.vue @@ -353,7 +353,7 @@ export default { </div> </div> <div class="gt-df ui segment main-graph"> - <div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto"> + <div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto"> <div v-if="isLoading"> <SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/> {{ locale.loadingInfo }} diff --git a/web_src/js/components/RepoRecentCommits.vue b/web_src/js/components/RepoRecentCommits.vue index 77697cd413..c1fd40f506 100644 --- a/web_src/js/components/RepoRecentCommits.vue +++ b/web_src/js/components/RepoRecentCommits.vue @@ -125,7 +125,7 @@ export default { {{ isLoading ? locale.loadingTitle : errorText ? locale.loadingTitleFailed: "Number of commits in the past year" }} </div> <div class="gt-df ui segment main-graph"> - <div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto"> + <div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto"> <div v-if="isLoading"> <SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/> {{ locale.loadingInfo }} diff --git a/web_src/js/features/repo-diff-commit.js b/web_src/js/features/repo-diff-commit.js index 3d4f0f677a..f0466f9320 100644 --- a/web_src/js/features/repo-diff-commit.js +++ b/web_src/js/features/repo-diff-commit.js @@ -39,7 +39,7 @@ function addLink(parent, href, text, tooltip) { link.href = href; link.textContent = text; if (tooltip) { - link.classList.add('gt-border-secondary', 'gt-rounded'); + link.classList.add('tw-border', 'tw-border-secondary', 'tw-rounded'); link.setAttribute('data-tooltip-content', tooltip); } parent.append(link); |