chore: Upgrade Tailwind CSS to 3.3.2 (#7380)

This commit is contained in:
Pranav Raj S
2023-06-26 11:27:16 -07:00
committed by GitHub
parent 212d7caab1
commit f1f14312fe
15 changed files with 3385 additions and 1116 deletions

View File

@@ -38,8 +38,8 @@ Vue.use(VueFormulate, {
isValidPhoneNumber: ({ value }) => isPhoneNumberValidWithDialCode(value), isValidPhoneNumber: ({ value }) => isPhoneNumberValidWithDialCode(value),
}, },
classes: { classes: {
outer: 'mb-4 wrapper', outer: 'mb-2 wrapper',
error: 'text-red-400 mt-2 text-xs font-medium', error: 'text-red-400 mt-2 text-xs leading-3 font-medium',
}, },
}); });
// Event Bus // Event Bus

View File

@@ -7,7 +7,7 @@
:href="brandRedirectURL" :href="brandRedirectURL"
rel="noreferrer noopener nofollow" rel="noreferrer noopener nofollow"
target="_blank" target="_blank"
class="branding--link justify-center" class="branding--link justify-center items-center leading-3"
> >
<img <img
class="branding--image" class="branding--image"

View File

@@ -34,9 +34,9 @@ export default {
}, },
computed: { computed: {
buttonClassName() { buttonClassName() {
let className = 'text-white py-3 px-4 rounded shadow-sm'; let className = 'text-white py-3 px-4 rounded shadow-sm leading-4';
if (this.type === 'clear') { if (this.type === 'clear') {
className = 'flex mx-auto mt-4 text-xs w-auto text-black-600'; className = 'flex mx-auto mt-4 text-xs leading-3 w-auto text-black-600';
} }
if (this.type === 'blue' && !Object.keys(this.buttonStyles).length) { if (this.type === 'blue' && !Object.keys(this.buttonStyles).length) {

View File

@@ -19,19 +19,19 @@
/> />
<div> <div>
<div <div
class="font-medium text-base flex items-center" class="font-medium text-base leading-4 flex items-center"
:class="$dm('text-black-900', 'dark:text-slate-50')" :class="$dm('text-black-900', 'dark:text-slate-50')"
> >
<span v-dompurify-html="title" class="mr-1" /> <span v-dompurify-html="title" class="mr-1" />
<div <div
:class=" :class="
`h-2 w-2 rounded-full leading-4 `h-2 w-2 rounded-full
${isOnline ? 'bg-green-500' : 'hidden'}` ${isOnline ? 'bg-green-500' : 'hidden'}`
" "
/> />
</div> </div>
<div <div
class="text-xs mt-1" class="text-xs mt-1 leading-3"
:class="$dm('text-black-700', 'dark:text-slate-400')" :class="$dm('text-black-700', 'dark:text-slate-400')"
> >
{{ replyWaitMessage }} {{ replyWaitMessage }}

View File

@@ -17,7 +17,7 @@
</div> </div>
<h2 <h2
v-dompurify-html="introHeading" v-dompurify-html="introHeading"
class="mt-5 text-3xl mb-3 font-normal" class="mt-5 text-3xl mb-3 leading-8 font-normal"
:class="$dm('text-slate-900', 'dark:text-slate-50')" :class="$dm('text-slate-900', 'dark:text-slate-50')"
/> />
<p <p

View File

@@ -1,6 +1,10 @@
<template> <template>
<label class="block"> <label class="block">
<div v-if="label" class="mb-2 text-xs font-medium" :class="labelClass"> <div
v-if="label"
class="mb-2 text-xs leading-3 font-medium"
:class="labelClass"
>
{{ label }} {{ label }}
</div> </div>
<input <input
@@ -11,12 +15,12 @@
:value="value" :value="value"
@change="onChange" @change="onChange"
/> />
<div v-if="error" class="text-red-400 mt-2 text-xs font-medium"> <div v-if="error" class="text-red-400 mt-2 text-xs leading-3 font-medium">
{{ error }} {{ error }}
</div> </div>
<div <div
v-if="!error && helpText" v-if="!error && helpText"
class="text-red-400 mt-2 text-xs font-medium" class="text-red-400 mt-2 text-xs leading-3 font-medium"
> >
{{ helpText }} {{ helpText }}
</div> </div>

View File

@@ -1,6 +1,10 @@
<template> <template>
<label class="block"> <label class="block">
<div v-if="label" class="mb-2 text-xs font-medium" :class="labelClass"> <div
v-if="label"
class="mb-2 text-xs leading-3 font-medium"
:class="labelClass"
>
{{ label }} {{ label }}
</div> </div>
<textarea <textarea
@@ -10,7 +14,7 @@
:value="value" :value="value"
@change="onChange" @change="onChange"
/> />
<div v-if="error" class="text-red-400 mt-2 text-xs font-medium"> <div v-if="error" class="text-red-400 mt-2 text-xs leading-3 font-medium">
{{ error }} {{ error }}
</div> </div>
</label> </label>

View File

@@ -46,7 +46,7 @@
/> />
<custom-button <custom-button
class="font-medium my-5" class="font-medium mt-2 mb-5"
block block
:bg-color="widgetColor" :bg-color="widgetColor"
:text-color="textColor" :text-color="textColor"
@@ -180,7 +180,7 @@ export default {
return contactAttributes; return contactAttributes;
}, },
inputStyles() { inputStyles() {
return `mt-2 border rounded w-full py-2 px-3 text-slate-700 outline-none`; return `mt-1 border rounded w-full py-2 px-3 text-slate-700 outline-none`;
}, },
isInputDarkOrLightMode() { isInputDarkOrLightMode() {
return `${this.$dm('bg-white', 'dark:bg-slate-600')} ${this.$dm( return `${this.$dm('bg-white', 'dark:bg-slate-600')} ${this.$dm(
@@ -306,6 +306,7 @@ export default {
.formulate-input-wrapper { .formulate-input-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
line-height: $space-normal;
label { label {
margin-left: 0.2rem; margin-left: 0.2rem;

View File

@@ -12,7 +12,7 @@
: $t('TEAM_AVAILABILITY.OFFLINE') : $t('TEAM_AVAILABILITY.OFFLINE')
}} }}
</div> </div>
<div class="text-xs leading-4 mt-1"> <div class="text-xs leading-3 mt-1">
{{ replyWaitMessage }} {{ replyWaitMessage }}
</div> </div>
</div> </div>

View File

@@ -21,7 +21,7 @@ export default {
}, },
textClass: { textClass: {
type: String, type: String,
default: 'text-sm', default: 'text-sm leading-3',
}, },
icon: { icon: {
type: Boolean, type: Boolean,

View File

@@ -3,6 +3,28 @@ const { VueLoaderPlugin } = require('vue-loader');
const resolve = require('./resolve'); const resolve = require('./resolve');
const vue = require('./loaders/vue'); const vue = require('./loaders/vue');
// Implementation reference: https://chwt.app/webpacker-tailwind-jit
const sassLoader = environment.loaders.get('sass');
const sassLoaderConfig = sassLoader.use.find(
element => element.loader === 'sass-loader'
);
const options = sassLoaderConfig.options;
options.implementation = require('sass');
const hotfixPostcssLoaderConfig = subloader => {
const subloaderName = subloader.loader;
if (subloaderName === 'postcss-loader') {
subloader.options.postcssOptions = subloader.options.config;
delete subloader.options.config;
}
};
environment.loaders.keys().forEach(loaderName => {
const loader = environment.loaders.get(loaderName);
loader.use.forEach(hotfixPostcssLoaderConfig);
});
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin()); environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin());
environment.loaders.prepend('vue', vue); environment.loaders.prepend('vue', vue);

View File

@@ -0,0 +1,21 @@
# Asset clean logic taken from the article https://chwt.app/heroku-slug-size
namespace :assets do
desc "Remove 'node_modules' folder"
task rm_node_modules: :environment do
Rails.logger.info 'Removing node_modules folder'
FileUtils.remove_dir('node_modules', true)
end
end
skip_clean = %w[no false n f].include?(ENV.fetch('WEBPACKER_PRECOMPILE', nil))
unless skip_clean
if Rake::Task.task_defined?('assets:clean')
Rake::Task['assets:clean'].enhance do
Rake::Task['assets:rm_node_modules'].invoke
end
else
Rake::Task.define_task('assets:clean' => 'assets:rm_node_modules')
end
end

View File

@@ -41,8 +41,9 @@
"@sentry/tracing": "^6.19.7", "@sentry/tracing": "^6.19.7",
"@sentry/vue": "^6.19.7", "@sentry/vue": "^6.19.7",
"@sindresorhus/slugify": "1.1.0", "@sindresorhus/slugify": "1.1.0",
"@tailwindcss/typography": "0.2.0", "@tailwindcss/typography": "^0.5.9",
"activestorage": "^5.2.6", "activestorage": "^5.2.6",
"autoprefixer": "^10.4.14",
"axios": "^0.21.2", "axios": "^0.21.2",
"babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0", "babel-plugin-transform-vue-jsx": "^3.7.0",
@@ -65,9 +66,11 @@
"md5": "^2.3.0", "md5": "^2.3.0",
"ninja-keys": "^1.1.9", "ninja-keys": "^1.1.9",
"opus-recorder": "^8.0.5", "opus-recorder": "^8.0.5",
"postcss": "^8.4.24",
"postcss-loader": "^4.2.0",
"semver": "7.3.5", "semver": "7.3.5",
"spinkit": "~1.2.5", "spinkit": "~1.2.5",
"tailwindcss": "^1.9.6", "tailwindcss": "^3.3.2",
"turbolinks": "^5.2.0", "turbolinks": "^5.2.0",
"url-loader": "^2.0.0", "url-loader": "^2.0.0",
"urlpattern-polyfill": "^6.0.2", "urlpattern-polyfill": "^6.0.2",
@@ -133,6 +136,7 @@
"jest-serializer-vue": "^2.0.2", "jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^2.0.0", "jest-transform-stub": "^2.0.0",
"lint-staged": "10.5.4", "lint-staged": "10.5.4",
"postcss-preset-env": "^8.5.1",
"prettier": "^1.16.4", "prettier": "^1.16.4",
"rimraf": "^3.0.0", "rimraf": "^3.0.0",
"size-limit": "^8.2.4", "size-limit": "^8.2.4",

View File

@@ -1,23 +1,17 @@
const { colors } = require('tailwindcss/defaultTheme');
module.exports = { module.exports = {
dark: 'class', dark: 'class',
purge: [ content: [
'./app/javascript/widget/**/*.vue', './app/javascript/widget/**/*.vue',
'./app/javascript/portal/**/*.vue', './app/javascript/portal/**/*.vue',
'./app/javascript/shared/**/*.vue', './app/javascript/shared/**/*.vue',
'./app/javascript/survey/**/*.vue', './app/javascript/survey/**/*.vue',
'./app/views/**/*.html.erb', './app/views/**/*.html.erb',
], ],
future: {
removeDeprecatedGapUtilities: true,
},
experimental: {
darkModeVariant: true,
},
theme: { theme: {
colors: { colors: {
white: colors.white, transparent: 'transparent',
white: '#fff',
current: 'currentColor',
woot: { woot: {
25: '#F5FAFF', 25: '#F5FAFF',
50: '#EBF5FF', 50: '#EBF5FF',
@@ -94,6 +88,7 @@ module.exports = {
800: '#D11320', 800: '#D11320',
900: '#C30011', 900: '#C30011',
}, },
body: '#2f3b49',
}, },
extend: { extend: {
screens: { screens: {

4390
yarn.lock

File diff suppressed because it is too large Load Diff