Frontend Tailwind Fixes + Small Fixes (#1258)

* Fix Tailwind not targeting the src dir

* Merge tw fixes

* Fix footer logo alignment in mobile layout
This commit is contained in:
Evan Song
2024-07-07 18:28:55 -07:00
committed by GitHub
parent df76d9a50a
commit dab284f339
23 changed files with 81 additions and 57 deletions

View File

@@ -300,7 +300,7 @@ export default defineNuxtConfig({
featureFlagOverrides: getFeatureFlagOverrides(), featureFlagOverrides: getFeatureFlagOverrides(),
owner: process.env.VERCEL_GIT_REPO_OWNER || "modrinth", owner: process.env.VERCEL_GIT_REPO_OWNER || "modrinth",
slug: process.env.VERCEL_GIT_REPO_SLUG || "knossos", slug: process.env.VERCEL_GIT_REPO_SLUG || "code",
branch: branch:
process.env.VERCEL_GIT_COMMIT_REF || process.env.VERCEL_GIT_COMMIT_REF ||
process.env.CF_PAGES_BRANCH || process.env.CF_PAGES_BRANCH ||

View File

@@ -1,5 +1,5 @@
<template> <template>
<span :class="'badge ' + color + ' type--' + type"> <span :class="'badge flex items-center gap-2 ' + color + ' type--' + type">
<template v-if="color"> <span class="circle" /> {{ $capitalizeString(type) }}</template> <template v-if="color"> <span class="circle" /> {{ $capitalizeString(type) }}</template>
<!-- User roles --> <!-- User roles -->

View File

@@ -53,8 +53,18 @@
>, has been updated: >, has been updated:
</template> </template>
<template v-else-if="type === 'team_invite' && project"> <template v-else-if="type === 'team_invite' && project">
<nuxt-link :to="`/user/${invitedBy.username}`" class="iconified-link title-link"> <nuxt-link
<Avatar :src="invitedBy.avatar_url" circle size="xxs" no-shadow :raised="raised" /> :to="`/user/${invitedBy.username}`"
class="iconified-link title-link inline-flex"
>
<Avatar
:src="invitedBy.avatar_url"
circle
size="xxs"
no-shadow
:raised="raised"
class="inline-flex"
/>
<span class="space">&nbsp;</span> <span class="space">&nbsp;</span>
<span>{{ invitedBy.username }}</span> <span>{{ invitedBy.username }}</span>
</nuxt-link> </nuxt-link>
@@ -66,8 +76,18 @@
</span> </span>
</template> </template>
<template v-else-if="type === 'organization_invite' && organization"> <template v-else-if="type === 'organization_invite' && organization">
<nuxt-link :to="`/user/${invitedBy.username}`" class="iconified-link title-link"> <nuxt-link
<Avatar :src="invitedBy.avatar_url" circle size="xxs" no-shadow :raised="raised" /> :to="`/user/${invitedBy.username}`"
class="iconified-link title-link inline-flex"
>
<Avatar
:src="invitedBy.avatar_url"
circle
size="xxs"
no-shadow
:raised="raised"
class="inline-flex"
/>
<span class="space">&nbsp;</span> <span class="space">&nbsp;</span>
<span>{{ invitedBy.username }}</span> <span>{{ invitedBy.username }}</span>
</nuxt-link> </nuxt-link>
@@ -172,9 +192,12 @@
</template> </template>
</div> </div>
<span class="notification__date"> <span class="notification__date">
<span v-if="notification.read" class="read-badge"> <ReadIcon /> Read </span> <span v-if="notification.read" class="read-badge inline-flex"> <ReadIcon /> Read </span>
<span v-tooltip="$dayjs(notification.created).format('MMMM D, YYYY [at] h:mm A')"> <span
<CalendarIcon /> Received {{ fromNow(notification.created) }} v-tooltip="$dayjs(notification.created).format('MMMM D, YYYY [at] h:mm A')"
class="inline-flex"
>
<CalendarIcon class="mr-1" /> Received {{ fromNow(notification.created) }}
</span> </span>
</span> </span>
<div v-if="compact" class="notification__actions"> <div v-if="compact" class="notification__actions">

View File

@@ -19,7 +19,7 @@
</nuxt-link> </nuxt-link>
<div class="title"> <div class="title">
<nuxt-link :to="`/${$getProjectTypeForUrl(type, categories)}/${id}`"> <nuxt-link :to="`/${$getProjectTypeForUrl(type, categories)}/${id}`">
<h2 class="name"> <h2 class="name !text-2xl">
{{ name }} {{ name }}
</h2> </h2>
</nuxt-link> </nuxt-link>

View File

@@ -328,10 +328,10 @@
<div class="logo-info" role="region" aria-label="Modrinth information"> <div class="logo-info" role="region" aria-label="Modrinth information">
<BrandTextLogo <BrandTextLogo
aria-hidden="true" aria-hidden="true"
class="text-logo button-base" class="text-logo button-base mx-auto mb-4 lg:mx-0"
@click="developerModeIncrement()" @click="developerModeIncrement()"
/> />
<p> <p class="mb-4">
<IntlFormatted :message-id="footerMessages.openSource"> <IntlFormatted :message-id="footerMessages.openSource">
<template #github-link="{ children }"> <template #github-link="{ children }">
<a <a
@@ -345,8 +345,8 @@
</template> </template>
</IntlFormatted> </IntlFormatted>
</p> </p>
<p> <p class="mb-4">
{{ config.public.owner }}/{{ config.public.slug }} {{ config.public.branch }}@<a {{ config.public.branch }}@<a
:target="$external()" :target="$external()"
:href=" :href="
'https://github.com/' + 'https://github.com/' +

View File

@@ -161,7 +161,7 @@
:class="{ 'has-featured-image': featuredGalleryImage }" :class="{ 'has-featured-image': featuredGalleryImage }"
> >
<nuxt-link <nuxt-link
class="project__gallery" class="project__gallery relative"
tabindex="-1" tabindex="-1"
:to=" :to="
'/' + '/' +
@@ -186,14 +186,14 @@
:src="project.icon_url" :src="project.icon_url"
:alt="project.title" :alt="project.title"
size="md" size="md"
class="project__icon" class="project__icon relative"
no-shadow no-shadow
/> />
<h1 class="title"> <h1 class="title">
{{ project.title }} {{ project.title }}
</h1> </h1>
<nuxt-link <nuxt-link
class="title-link project-type" class="title-link project-type flex items-center gap-1"
:to="`/${$getProjectTypeForUrl(project.actualProjectType, project.loaders)}s`" :to="`/${$getProjectTypeForUrl(project.actualProjectType, project.loaders)}s`"
> >
<BoxIcon /> <BoxIcon />

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="universal-card"> <div class="universal-card">
<CollectionCreateModal ref="modal_creation" /> <CollectionCreateModal ref="modal_creation" />
<h2>{{ formatMessage(commonMessages.collectionsLabel) }}</h2> <h2 class="text-2xl">{{ formatMessage(commonMessages.collectionsLabel) }}</h2>
<div class="search-row"> <div class="search-row">
<div class="iconified-input"> <div class="iconified-input">
<label for="search-input" hidden>{{ formatMessage(messages.searchInputLabel) }}</label> <label for="search-input" hidden>{{ formatMessage(messages.searchInputLabel) }}</label>

View File

@@ -15,7 +15,7 @@
<div class="dashboard-notifications"> <div class="dashboard-notifications">
<section class="universal-card"> <section class="universal-card">
<div class="header__row"> <div class="header__row">
<h2 class="header__title">Notifications</h2> <h2 class="header__title text-2xl">Notifications</h2>
<nuxt-link <nuxt-link
v-if="notifications.length > 0" v-if="notifications.length > 0"
class="goto-link" class="goto-link"
@@ -38,7 +38,7 @@
/> />
<nuxt-link <nuxt-link
v-if="extraNotifs > 0" v-if="extraNotifs > 0"
class="goto-link view-more-notifs" class="goto-link view-more-notifs mt-4"
to="/dashboard/notifications" to="/dashboard/notifications"
> >
View {{ extraNotifs }} more notification{{ extraNotifs === 1 ? "" : "s" }} View {{ extraNotifs }} more notification{{ extraNotifs === 1 ? "" : "s" }}
@@ -47,7 +47,7 @@
</template> </template>
<div v-else class="universal-body"> <div v-else class="universal-body">
<p>You have no unread notifications.</p> <p>You have no unread notifications.</p>
<nuxt-link class="iconified-button" to="/dashboard/notifications/history"> <nuxt-link class="iconified-button !mt-4" to="/dashboard/notifications/history">
<HistoryIcon /> View notification history <HistoryIcon /> View notification history
</nuxt-link> </nuxt-link>
</div> </div>

View File

@@ -8,8 +8,8 @@
/> />
<div class="header__row"> <div class="header__row">
<div class="header__title"> <div class="header__title">
<h2 v-if="history">Notification history</h2> <h2 v-if="history" class="text-2xl">Notification history</h2>
<h2 v-else>Notifications</h2> <h2 v-else class="text-2xl">Notifications</h2>
</div> </div>
<template v-if="!history"> <template v-if="!history">
<Button v-if="hasRead" @click="updateRoute()"> <HistoryIcon /> View history </Button> <Button v-if="hasRead" @click="updateRoute()"> <HistoryIcon /> View history </Button>

View File

@@ -3,7 +3,7 @@
<OrganizationCreateModal ref="createOrgModal" /> <OrganizationCreateModal ref="createOrgModal" />
<section class="universal-card"> <section class="universal-card">
<div class="header__row"> <div class="header__row">
<h2 class="header__title">Organizations</h2> <h2 class="header__title text-2xl">Organizations</h2>
<div class="input-group"> <div class="input-group">
<button class="iconified-button brand-button" @click="openCreateOrgModal"> <button class="iconified-button brand-button" @click="openCreateOrgModal">
<PlusIcon /> <PlusIcon />

View File

@@ -159,7 +159,7 @@
<ModalCreation ref="modal_creation" /> <ModalCreation ref="modal_creation" />
<section class="universal-card"> <section class="universal-card">
<div class="header__row"> <div class="header__row">
<h2 class="header__title">Projects</h2> <h2 class="header__title text-2xl">Projects</h2>
<div class="input-group"> <div class="input-group">
<button class="iconified-button brand-button" @click="$refs.modal_creation.show()"> <button class="iconified-button brand-button" @click="$refs.modal_creation.show()">
<PlusIcon /> <PlusIcon />

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<section class="universal-card"> <section class="universal-card">
<h2>Reports</h2> <h2 class="text-2xl">Reports</h2>
<ReportsList :auth="auth" /> <ReportsList :auth="auth" />
</section> </section>
</div> </div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<section class="universal-card"> <section class="universal-card">
<h2>Revenue</h2> <h2 class="text-2xl">Revenue</h2>
<div v-if="auth.user.payout_data.balance >= minWithdraw"> <div v-if="auth.user.payout_data.balance >= minWithdraw">
<p> <p>
You have You have
@@ -14,7 +14,7 @@
<strong>{{ $formatMoney(auth.user.payout_data.balance) }}</strong <strong>{{ $formatMoney(auth.user.payout_data.balance) }}</strong
>, which is under the minimum of ${{ minWithdraw }} to withdraw. >, which is under the minimum of ${{ minWithdraw }} to withdraw.
</p> </p>
<div class="input-group"> <div class="input-group mt-4">
<nuxt-link <nuxt-link
v-if="auth.user.payout_data.balance >= minWithdraw" v-if="auth.user.payout_data.balance >= minWithdraw"
class="iconified-button brand-button" class="iconified-button brand-button"
@@ -34,7 +34,7 @@
</p> </p>
</section> </section>
<section class="universal-card"> <section class="universal-card">
<h2>Payout methods</h2> <h2 class="text-2xl">Payout methods</h2>
<h3>PayPal</h3> <h3>PayPal</h3>
<template v-if="auth.user.auth_providers.includes('paypal')"> <template v-if="auth.user.auth_providers.includes('paypal')">
<p> <p>
@@ -42,13 +42,13 @@
email email
{{ auth.user.payout_data.paypal_address }} {{ auth.user.payout_data.paypal_address }}
</p> </p>
<button class="btn" @click="removeAuthProvider('paypal')"> <button class="btn mt-4" @click="removeAuthProvider('paypal')">
<XIcon /> Disconnect account <XIcon /> Disconnect account
</button> </button>
</template> </template>
<template v-else> <template v-else>
<p>Connect your PayPal account to enable withdrawing to your PayPal balance.</p> <p>Connect your PayPal account to enable withdrawing to your PayPal balance.</p>
<a class="btn" :href="`${getAuthUrl('paypal')}&token=${auth.token}`"> <a class="btn mt-4" :href="`${getAuthUrl('paypal')}&token=${auth.token}`">
<PayPalIcon /> <PayPalIcon />
Sign in with PayPal Sign in with PayPal
</a> </a>
@@ -65,6 +65,7 @@
<input <input
id="venmo" id="venmo"
v-model="auth.user.payout_data.venmo_handle" v-model="auth.user.payout_data.venmo_handle"
class="mt-4"
type="search" type="search"
name="search" name="search"
placeholder="@example" placeholder="@example"

View File

@@ -291,7 +291,7 @@
</div> </div>
</Modal> </Modal>
<section class="universal-card"> <section class="universal-card">
<h2>Account security</h2> <h2 class="text-2xl">Account security</h2>
<div class="adjacent-input"> <div class="adjacent-input">
<label for="theme-selector"> <label for="theme-selector">

View File

@@ -128,7 +128,7 @@
<div class="header__row"> <div class="header__row">
<div class="header__title"> <div class="header__title">
<h2>{{ formatMessage(commonSettingsMessages.applications) }}</h2> <h2 class="text-2xl">{{ formatMessage(commonSettingsMessages.applications) }}</h2>
</div> </div>
<button <button
class="btn btn-primary" class="btn btn-primary"
@@ -152,7 +152,7 @@
information, see information, see
<a class="text-link" href="https://docs.modrinth.com">Modrinth's API documentation</a>. <a class="text-link" href="https://docs.modrinth.com">Modrinth's API documentation</a>.
</p> </p>
<div v-for="app in usersApps" :key="app.id" class="universal-card recessed token"> <div v-for="app in usersApps" :key="app.id" class="universal-card recessed token mt-4">
<div class="token-info"> <div class="token-info">
<div class="token-icon"> <div class="token-icon">
<Avatar size="sm" :src="app.icon_url" /> <Avatar size="sm" :src="app.icon_url" />

View File

@@ -7,7 +7,7 @@
proceed-label="Revoke" proceed-label="Revoke"
@proceed="revokeApp(revokingId)" @proceed="revokeApp(revokingId)"
/> />
<h2>{{ formatMessage(commonSettingsMessages.authorizedApps) }}</h2> <h2 class="text-2xl">{{ formatMessage(commonSettingsMessages.authorizedApps) }}</h2>
<p> <p>
When you authorize an application with your Modrinth account, you grant it access to your When you authorize an application with your Modrinth account, you grant it access to your
account. You can manage and review access to your account here at any time. account. You can manage and review access to your account here at any time.
@@ -18,7 +18,7 @@
<div <div
v-for="authorization in appInfoLookup" v-for="authorization in appInfoLookup"
:key="authorization.id" :key="authorization.id"
class="universal-card recessed token" class="universal-card recessed token mt-4"
> >
<div class="token-content"> <div class="token-content">
<div> <div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<MessageBanner v-if="flags.developerMode" message-type="warning" class="developer-message"> <MessageBanner v-if="flags.developerMode" message-type="warning" class="developer-message">
<CodeIcon /> <CodeIcon class="inline-flex" />
<IntlFormatted :message-id="developerModeBanner.description"> <IntlFormatted :message-id="developerModeBanner.description">
<template #strong="{ children }"> <template #strong="{ children }">
<strong> <strong>
@@ -14,9 +14,9 @@
</Button> </Button>
</MessageBanner> </MessageBanner>
<section class="universal-card"> <section class="universal-card">
<h2>{{ formatMessage(colorTheme.title) }}</h2> <h2 class="text-2xl">{{ formatMessage(colorTheme.title) }}</h2>
<p>{{ formatMessage(colorTheme.description) }}</p> <p>{{ formatMessage(colorTheme.description) }}</p>
<div class="theme-options"> <div class="theme-options mt-4">
<button <button
v-for="option in themeOptions" v-for="option in themeOptions"
:key="option" :key="option"
@@ -50,8 +50,8 @@
</div> </div>
</section> </section>
<section class="universal-card"> <section class="universal-card">
<h2>{{ formatMessage(projectListLayouts.title) }}</h2> <h2 class="text-2xl">{{ formatMessage(projectListLayouts.title) }}</h2>
<p>{{ formatMessage(projectListLayouts.description) }}</p> <p class="mb-4">{{ formatMessage(projectListLayouts.description) }}</p>
<div class="project-lists"> <div class="project-lists">
<div v-for="projectType in listTypes" :key="projectType.id + '-project-list-layouts'"> <div v-for="projectType in listTypes" :key="projectType.id + '-project-list-layouts'">
<div class="label"> <div class="label">
@@ -137,8 +137,8 @@
</div> </div>
</section> </section>
<section class="universal-card"> <section class="universal-card">
<h2>{{ formatMessage(toggleFeatures.title) }}</h2> <h2 class="text-2xl">{{ formatMessage(toggleFeatures.title) }}</h2>
<p>{{ formatMessage(toggleFeatures.description) }}</p> <p class="mb-4">{{ formatMessage(toggleFeatures.description) }}</p>
<div class="adjacent-input small"> <div class="adjacent-input small">
<label for="advanced-rendering"> <label for="advanced-rendering">
<span class="label__title"> <span class="label__title">

View File

@@ -285,7 +285,7 @@ function getItemLabel(locale: Locale) {
<template> <template>
<div> <div>
<section class="universal-card"> <section class="universal-card">
<h2>{{ formatMessage(commonSettingsMessages.language) }}</h2> <h2 class="text-2xl">{{ formatMessage(commonSettingsMessages.language) }}</h2>
<div class="card-description"> <div class="card-description">
<IntlFormatted :message-id="messages.languagesDescription"> <IntlFormatted :message-id="messages.languagesDescription">

View File

@@ -74,7 +74,7 @@
<div class="header__row"> <div class="header__row">
<div class="header__title"> <div class="header__title">
<h2>{{ formatMessage(commonSettingsMessages.pats) }}</h2> <h2 class="text-2xl">{{ formatMessage(commonSettingsMessages.pats) }}</h2>
</div> </div>
<button <button
class="btn btn-primary" class="btn btn-primary"

View File

@@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<section class="card"> <section class="card">
<h2>{{ formatMessage(messages.title) }}</h2> <h2 class="text-2xl">{{ formatMessage(messages.title) }}</h2>
<p> <p class="mb-4">
<IntlFormatted :message-id="messages.description"> <IntlFormatted :message-id="messages.description">
<template #docs-link="{ children }"> <template #docs-link="{ children }">
<a href="https://docs.modrinth.com/" target="_blank" class="text-link"> <a href="https://docs.modrinth.com/" target="_blank" class="text-link">

View File

@@ -1,10 +1,10 @@
<template> <template>
<div class="universal-card"> <div class="universal-card">
<h2>{{ formatMessage(commonSettingsMessages.sessions) }}</h2> <h2 class="text-2xl">{{ formatMessage(commonSettingsMessages.sessions) }}</h2>
<p class="preserve-lines"> <p class="preserve-lines">
{{ formatMessage(messages.sessionsDescription) }} {{ formatMessage(messages.sessionsDescription) }}
</p> </p>
<div v-for="session in sessions" :key="session.id" class="universal-card recessed session"> <div v-for="session in sessions" :key="session.id" class="universal-card recessed session mt-4">
<div> <div>
<div> <div>
<strong> <strong>

View File

@@ -1,13 +1,13 @@
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = { module.exports = {
content: [ content: [
"./components/**/*.{js,vue,ts}", "./src/components/**/*.{js,vue,ts}",
"./layouts/**/*.vue", "./src/layouts/**/*.vue",
"./pages/**/*.vue", "./src/pages/**/*.vue",
"./plugins/**/*.{js,ts}", "./src/plugins/**/*.{js,ts}",
"./app.vue", "./src/app.vue",
"./error.vue", "./src/error.vue",
// monorepo // monorepo - TODO: migrate this to its own package
"../../packages/**/*.{js,vue,ts}", "../../packages/**/*.{js,vue,ts}",
], ],
theme: { theme: {

View File

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" /> <path stroke-linecap="round" stroke-linejoin="round" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 326 B