Skip to content

Commit

Permalink
Move dynamic tailwind colors into safelist
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewStanciu committed Sep 26, 2023
1 parent ace8692 commit 0b1e4eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 0 additions & 3 deletions components/email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ const Email = () => {

const { error } = await res.json();
if (error) {
console.log(error);
setErrorMessage('Email failed to send :( \nPlease try again.');
setStatus(Status.Error);
setStatusColor(StatusColor.Error);
Expand Down Expand Up @@ -288,7 +287,6 @@ const Email = () => {
>
Send
</button>
<div className="bg-green-500 bg-amber-400 bg-red-500 bg-blue-400"></div>
<div className="bg-white ml-5 font-mono text-sm border-2 border-black px-2 py-2">
status:{' '}
<span
Expand Down Expand Up @@ -525,7 +523,6 @@ const Email = () => {
className={`border-2 border-black w-11/12 sm:w-[32rem] sm:min-w-[28rem]
shadow-email shadow-gray-900/30 h-fit absolute z-[${i}0] overflow-hidden`}
>
<div className="bg-orange-300 bg-lime-300 bg-pink-300 bg-yellow-300 bg-blue-300"></div>
<div
className={`border-b-2 border-black flex flex-row bg-${email.color}-300 cursor-pointer`}
>
Expand Down
11 changes: 11 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ module.exports = {
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}'
],
safelist: [
'bg-green-500',
'bg-amber-400',
'bg-red-500',
'bg-blue-400',
'bg-orange-300',
'bg-lime-300',
'bg-pink-300',
'bg-yellow-300',
'bg-blue-300'
],
theme: {
fontFamily: {
main: ['var(--font-space-grotesk)'],
Expand Down

0 comments on commit 0b1e4eb

Please sign in to comment.