Skip to content

Commit cb30a6a

Browse files
pkp/pkp-lib#10850 Migrate TailwindCSS from v3 to v4
1 parent 1da3e2f commit cb30a6a

28 files changed

+758
-834
lines changed

package-lock.json

+554-560
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
"@storybook/blocks": "^8.5.3",
5555
"@storybook/vue3": "^8.5.3",
5656
"@storybook/vue3-vite": "^8.5.3",
57+
"@tailwindcss/postcss": "^4.0.0",
5758
"@vitejs/plugin-vue": "^5.0.3",
5859
"@vue/eslint-config-prettier": "^8.0.0",
59-
"autoprefixer": "^10.4.14",
6060
"chromatic": "^9.1.0",
6161
"cross-env": "^7.0.3",
6262
"eslint": "^8.48.0",
@@ -70,17 +70,16 @@
7070
"msw-storybook-addon": "^2.0.4",
7171
"postcss": "^8.4.27",
7272
"prettier": "^3.0.2",
73-
"prettier-plugin-tailwindcss": "^0.5.11",
73+
"prettier-plugin-tailwindcss": "^0.6.11",
7474
"storybook": "^8.5.3",
7575
"storybook-mock-date-decorator": "^2.0.6",
76-
"tailwindcss": "3.4",
76+
"tailwindcss": "^4.0.0",
7777
"vite": "^5.0.12",
7878
"vitest": "^1.0.4"
7979
},
8080
"postcss": {
8181
"plugins": {
82-
"autoprefixer": {},
83-
"tailwindcss": {}
82+
"@tailwindcss/postcss": {}
8483
}
8584
},
8685
"prettier": {

public/styles/content.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "fonts.css";
1+
@import './fonts.css';
22

33
html,
44
body {

public/styles/content_oneline.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "content.css";
1+
@import './content.css';
22

33
html {
44
padding: 0;

public/styles/tinymce/skin.mobile.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Button/Button.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
:disabled="element === 'a' && !isDisabled ? undefined : isDisabled"
1111
@click="click"
1212
@focus="emit('focus')"
13-
@blur="emit('blur')"
13+
@blur="emit('blur-sm')"
1414
>
1515
<Icon v-if="icon" class="h-5 w-5" :icon="icon" aria-hidden="true" />
1616
<slot />
@@ -101,6 +101,6 @@ const emit = defineEmits([
101101
/** When the button receives focus. */
102102
'focus',
103103
/** When focus moves away from the button. */
104-
'blur',
104+
'blur-sm',
105105
]);
106106
</script>

src/components/ButtonIcon/ButtonIcon.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const styles = computed(() => ({
4141
// Active
4242
'text-on-dark bg-selection-dark border-transparent': props.isActive,
4343
// Disabled
44-
'hover:text-disabled hover:bg-secondary !text-disabled cursor-not-allowed':
44+
'hover:text-disabled hover:bg-secondary text-disabled! cursor-not-allowed':
4545
props.isDisabled,
4646
}));
4747
</script>

src/components/DropdownActions/DropdownActions.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<span v-if="!displayAsEllipsis">{{ label }}</span>
1212
<Icon
1313
v-if="buttonVariant === 'dropdown'"
14-
class="h-5 w-5 text-primary"
14+
class="text-primary h-5 w-5"
1515
icon="Dropdown"
1616
aria-hidden="true"
1717
/>
@@ -32,7 +32,7 @@
3232
leave-to-class="transform opacity-0 scale-95"
3333
>
3434
<MenuItems
35-
class="absolute z-10 w-max border border-light bg-secondary shadow focus:outline-none"
35+
class="border-light bg-secondary absolute z-10 w-max border shadow focus:outline-hidden"
3636
:class="
3737
direction === 'right'
3838
? 'ltr:left-0 ltr:origin-top-left rtl:right-0 rtl:origin-top-left'

src/components/Form/FormPage.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{{ t('common.saving') }}
3434
</span>
3535
<span v-else-if="hasRecentSave" class="pkpFormPage__status">
36-
<Icon icon="Complete" class="h-5 w-5 text-success" :inline="true" />
36+
<Icon icon="Complete" class="text-success h-5 w-5" :inline="true" />
3737
{{ t('form.saved') }}
3838
</span>
3939
</transition>
@@ -240,7 +240,7 @@ export default {
240240
241241
> .pkpButton {
242242
white-space: nowrap;
243-
flex-shrink: 0;
243+
shrink: 0;
244244
}
245245
}
246246
@@ -254,7 +254,7 @@ export default {
254254
font-size: @font-tiny;
255255
transition: all 0.3s;
256256
white-space: nowrap;
257-
flex-shrink: 0;
257+
shrink: 0;
258258
259259
.pkpSpinner {
260260
margin-inline-end: 0.25rem;

src/components/Form/fields/Autosuggest.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ defineExpose({handleFocus});
260260
.pkpAutosuggest__autosuggester {
261261
position: relative;
262262
line-height: 1.6rem; // prevent jank when value is added or removed
263-
flex-grow: 1;
263+
grow: 1;
264264
}
265265
266266
.autosuggest__results {

src/components/Form/fields/FieldRichText.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ export default {
124124
* (v5.10.7).
125125
*
126126
* This is a workaround that closes the popup toolbar when the TinyMCE
127-
* editor fires the `blur` event. This works, but the `blur` event does
127+
* editor fires the `blur-sm` event. This works, but the `blur-sm` event does
128128
* not cover every case. It is possible to open the popup toolbar without
129-
* moving focus into the editor. In such cases, the `blur` event is not
129+
* moving focus into the editor. In such cases, the `blur-sm` event is not
130130
* fired.
131131
*
132132
* To prevent such cases, we have hidden the popup toolbar button when

src/components/Form/fields/FieldRichTextarea.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
:plugins="plugins"
5454
:init="compiledInit"
5555
@focus="focus"
56-
@blur="blur"
56+
@blur="blur - sm"
5757
/>
5858
<div
5959
v-if="(isMultilingual && locales.length > 1) || wordLimit"
@@ -257,7 +257,7 @@ export default {
257257
// This mimics the focus event, without actually changing the user's
258258
// focus.
259259
editor.fire('focus');
260-
editor.fire('blur');
260+
editor.fire('blur-sm');
261261
},
262262
...this.init,
263263
};

src/components/Form/fields/FieldSlider.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
:pt="sliderStyling"
5050
/>
5151
</div>
52-
<div class="mt-2 flex justify-between text-base-normal text-secondary">
52+
<div class="text-base-normal text-secondary mt-2 flex justify-between">
5353
<div>{{ minLabel || min }}</div>
5454
<div>{{ maxLabel || max }}</div>
5555
</div>
5656
</div>
5757
<div
58-
class="ms-3 w-48 self-start rounded border border-form-fields p-2 text-center text-base-normal text-secondary"
58+
class="border-form-fields text-base-normal text-secondary ms-3 w-48 self-start rounded border p-2 text-center"
5959
>
6060
{{ displayedValue }}
6161
</div>
@@ -147,7 +147,7 @@ export default {
147147
148148
// States
149149
'hover:bg-hover hover:border-primary-500',
150-
'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring',
150+
'focus-visible:outline-hidden focus-visible:outline-offset-0 focus-visible:ring-3',
151151
'ring-primary/50',
152152
// Transitions
153153
'transition duration-200',

src/components/Form/fields/FieldUpload.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ export default {
474474
}
475475
476476
.dz-details {
477-
flex-grow: 1;
477+
grow: 1;
478478
}
479479
480480
.dz-filename {

src/components/InsertContent/InsertContent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,6 @@ export default {
151151
152152
.insertContent__item__button {
153153
margin-inline-start: auto;
154-
flex-shrink: 0;
154+
shrink: 0;
155155
}
156156
</style>

src/components/ListPanel/listingFiles/ListingFilesListPanel.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
</template>
99
<template #item="{item}">
1010
<div class="flex items-center">
11-
<div class="me-2 flex-grow truncate">
11+
<div class="me-2 grow truncate">
1212
<File
1313
:name="localize(item.name)"
1414
:document-type="item.documentType"
1515
:url="item.url"
1616
/>
1717
</div>
18-
<div class="flex-shrink-0">
18+
<div class="shrink-0">
1919
<Badge
2020
v-if="item.genreName"
2121
:is-primary="!item.genreIsDependent && !item.genreIsSupplementary"

src/components/ListPanel/submissionFiles/SelectSubmissionFileListItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default {
148148
.selectSubmissionFileListItem__selector {
149149
width: 3rem;
150150
text-align: center;
151-
flex-shrink: 0;
151+
shrink: 0;
152152
}
153153
154154
.selectSubmissionFileListItem__download {

src/components/Modal/Dialog.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
leave-to="opacity-0"
1212
>
1313
<div
14-
class="fixed inset-0 z-10 bg-blur bg-opacity-75 transition-opacity"
14+
class="bg-blur bg-opacity-75 fixed inset-0 z-10 transition-opacity"
1515
/>
1616
</TransitionChild>
1717
<div class="fixed inset-0 z-20 overflow-y-auto">
@@ -30,11 +30,11 @@
3030
<DialogPanel data-cy="dialog" :class="styles">
3131
<button
3232
v-if="noActions"
33-
class="absolute right-3 top-3 cursor-pointer bg-transparent"
33+
class="absolute top-3 right-3 cursor-pointer bg-transparent"
3434
@click="onClose"
3535
>
3636
<Icon
37-
class="h-6 w-6 text-negative"
37+
class="text-negative h-6 w-6"
3838
icon="Cancel"
3939
:aria-hidden="true"
4040
/>
@@ -45,11 +45,11 @@
4545
<div class="flex min-h-12 items-center">
4646
<DialogTitle
4747
v-if="title"
48-
class="m-0 inline-flex min-w-[1px] items-center overflow-x-hidden overflow-ellipsis px-8 pt-12 text-4xl-bold"
48+
class="text-4xl-bold m-0 inline-flex min-w-[1px] items-center overflow-x-hidden px-8 pt-12 text-ellipsis"
4949
:class="icon ? 'pb-5' : 'pb-8'"
5050
>
5151
<div v-if="icon" :class="iconStyles">
52-
<Icon :icon="icon" class="h-11 w-11 text-on-dark"></Icon>
52+
<Icon :icon="icon" class="text-on-dark h-11 w-11"></Icon>
5353
</div>
5454
<span class="px-4">{{ title }}</span>
5555
</DialogTitle>

src/components/Modal/SideModal.stories.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ const SideModalWithSideMenu = {
535535
<SideModalLayout2Columns>
536536
<template #left>
537537
<div class="flex">
538-
<div class="flex-shrink-0">
538+
<div class="shrink-0">
539539
<SideMenu v-bind="sideMenuProps"></SideMenu>
540540
</div>
541541
<p class="px-5">

src/components/Modal/SideModalBody.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
class="pointer-events-auto h-screen w-screen"
44
:class="levelClasses"
55
>
6-
<div class="shadow-xl flex h-full flex-col bg-default py-6">
6+
<div class="bg-default flex h-full flex-col py-6 shadow-xl">
77
<div class="">
88
<div class="flex items-start">
99
<div class="ms-4">
1010
<button
1111
type="button"
12-
class="rounded-md text-gray-400 hover:text-gray-500 focus:ring-indigo-500 relative inline-flex focus:outline-none focus:ring-2 focus:ring-offset-2"
12+
class="relative inline-flex rounded-md text-gray-400 hover:text-gray-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden"
1313
@click="closeModal"
1414
>
1515
<span class="sr-only">{{ t('common.close') }}</span>
1616
<Icon
17-
class="h-8 w-8 text-primary"
17+
class="text-primary h-8 w-8"
1818
icon="BackButton"
1919
:aria-hidden="true"
2020
/>
2121
</button>
2222
</div>
23-
<div class="ml-8 mr-8 flex-grow" data-cy="sidemodal-header">
23+
<div class="mr-8 ml-8 grow" data-cy="sidemodal-header">
2424
<div class="flex">
25-
<div class="flex-grow">
25+
<div class="grow">
2626
<!-- @slot Small text above title, might be useful for example to display submission Id-->
2727
<div class="text-xl-medium"><slot name="pre-title"></slot></div>
28-
<DialogTitle as="h1" class="mt-1 text-4xl-bold text-heading">
28+
<DialogTitle as="h1" class="text-4xl-bold text-heading mt-1">
2929
<!-- @slot Main title, also used for accessibility (aria-labelledby) -->
3030
<slot name="title"></slot>
3131
</DialogTitle>
32-
<DialogDescription class="mt-1 text-3xl-normal">
32+
<DialogDescription class="text-3xl-normal mt-1">
3333
<!-- @slot Optionally descrition, also used for accessibility (aria-describedby) -->
3434
<slot name="description"></slot>
3535
</DialogDescription>

src/components/Modal/SideModalLayout2Columns.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
2-
<div class="flex w-full border-t border-light">
3-
<div class="flex-grow border-e border-light p-4">
2+
<div class="border-light flex w-full border-t">
3+
<div class="border-light grow border-e p-4">
44
<div class="bg-secondary p-5">
55
<slot name="left"></slot>
66
</div>
77
</div>
88
<div class="w-96">
9-
<div class="border-b border-light p-4">
9+
<div class="border-light border-b p-4">
1010
<slot name="right1"></slot>
1111
</div>
1212
<div class="p-4">

src/components/Modal/SideModalLayoutMenu2Columns.vue

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<template>
22
<div class="min-w-max p-4">
3-
<div class="flex w-full bg-secondary">
4-
<div class="flex flex-col border-t border-light">
3+
<div class="bg-secondary flex w-full">
4+
<div class="border-light flex flex-col border-t">
55
<slot name="menu"></slot>
6-
<div class="flex-grow border-x border-b border-light bg-tertiary"></div>
6+
<div class="border-light bg-tertiary grow border-x border-b"></div>
77
</div>
8-
<div class="flex w-full flex-col border-y border-e border-s border-light">
8+
<div class="border-light flex w-full flex-col border-y border-s border-e">
99
<div
10-
class="border-b border-light p-5 text-3xl-bold uppercase text-heading"
10+
class="border-light text-3xl-bold text-heading border-b p-5 uppercase"
1111
>
1212
<slot name="heading"></slot>
1313
</div>
14-
<div class="flex-grow">
14+
<div class="grow">
1515
<div class="flex h-full">
16-
<div class="flex-grow border-e border-light">
16+
<div class="border-light grow border-e">
1717
<div
1818
v-if="
1919
$slots['publication-controls-left'] ||
2020
$slots['publication-controls-right']
2121
"
22-
class="flex justify-between border-b border-light p-4"
22+
class="border-light flex justify-between border-b p-4"
2323
>
2424
<div class="">
2525
<slot name="publication-controls-left"></slot>
@@ -33,9 +33,9 @@
3333
</div>
3434
<div
3535
v-if="$slots.secondary || $slots.actions"
36-
class="w-96 border-s border-light"
36+
class="border-light w-96 border-s"
3737
>
38-
<div class="border-b border-light"><slot name="actions" /></div>
38+
<div class="border-light border-b"><slot name="actions" /></div>
3939
<div><slot name="secondary"></slot></div>
4040
</div>
4141
</div>

0 commit comments

Comments
 (0)