Skip to content

Commit

Permalink
feat: update dependencies and delete unused theme utilities
Browse files Browse the repository at this point in the history
This commit removes unused custom utilities and updates the version of eleganceui-tailwind-utilities in the package.json. Also, changes were made in the tailwind.config.ts to no longer use the deleted utilities. The code cleanup improves readability and reduces overall complexity.
  • Loading branch information
everton-dgn committed Mar 31, 2024
1 parent 02584e3 commit bd830e0
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 204 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"dev": "next dev",
"start": "next start",
"build": "next build",
"build": "next build --no-lint",
"lint": "eslint --cache src --ext ts,tsx --max-warnings=0",
"lint:fix": "eslint --cache --fix src --ext ts,tsx",
"next:lint": "next lint",
Expand Down Expand Up @@ -48,7 +48,7 @@
"devDependencies": {
"dotenv": "^16.3.1",
"@commitlint/cli": "^18.4.4",
"eleganceui-tailwind-utilities": "^2.1.0",
"eleganceui-tailwind-utilities": "^3.0.0",
"@commitlint/config-conventional": "^18.4.4",
"@playwright/test": "^1.41.0",
"@testing-library/dom": "^9.3.4",
Expand Down
2 changes: 1 addition & 1 deletion src/theme/components/underlined-title.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@layer components {
.underlined-title {
@apply max-w-fit text-20 font-700 uppercase text-primary-500 after-base after:mt-8 after:h-4 after:w-[30%] after:rounded-4 after:bg-secondary-500;
@apply fs-20 font-700 max-w-fit uppercase after-base tx-primary-500 after:mt-8 after:h-4 after:w-[30%] after:bg-secondary-500 after:br;
}
}
21 changes: 8 additions & 13 deletions src/theme/reset.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@layer base {
* {
outline: none;
line-height: calc(1em + 0.5rem);
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
@apply m-0 box-border list-none p-0 font-sans no-underline antialiased;
Expand All @@ -21,12 +20,8 @@
}
}

html {
@apply text-[62.5%];
}

body {
@apply isolate min-h-screen bg-soft-white-blue pb-[50px] text-dark col-full jc-start;
@apply isolate min-h-screen bg-soft-white-blue pb-12 col-full jc-start tx-dark;

@screen sm {
@apply pb-0;
Expand All @@ -45,7 +40,7 @@

b,
strong {
@apply font-700;
@apply font-bold;
}

optgroup,
Expand All @@ -54,7 +49,7 @@
select,
textarea,
button {
@apply m-0 font-sans text-16 font-500;
@apply m-0 font-sans font-medium fs-base;
}

button {
Expand All @@ -68,11 +63,11 @@

:focus,
:focus-visible {
@apply outline outline-4 outline-offset-1 outline-focus;
@apply otl-4-focus otl-o-1;
}

:focus:not(:focus-visible) {
@apply outline-0;
@apply otl-0;
}

mark {
Expand All @@ -81,7 +76,7 @@
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(100%);
content: ' [start of highlighted text] ';
@apply absolute h-1 w-1 overflow-hidden whitespace-nowrap;
@apply absolute h-px w-px ov-hidden whitespace-nowrap;
}

&::after {
Expand All @@ -91,11 +86,11 @@

::-webkit-scrollbar,
scrollbar-width {
@apply w-12 bg-soft-white-blue;
@apply w-3 bg-soft-white-blue;
}

::-webkit-scrollbar-thumb {
@apply rounded-20 border border-solid border-soft-white-blue bg-grey-light-500;
@apply br-5 bw-soft-white-blue bg-grey-light-500;
}

:root {
Expand Down
17 changes: 0 additions & 17 deletions src/theme/utilities/directional.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/theme/utilities/fontSize.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/theme/utilities/fontWeight.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/theme/utilities/gap.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/theme/utilities/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/theme/utilities/lineHeight.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/theme/utilities/size.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/theme/variables/fontSizes.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/theme/variables/fontWeights.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const fontWeights = {
700: '700',
600: '600',
500: '500'
bold: '700',
semibold: '600',
medium: '500'
}
8 changes: 2 additions & 6 deletions src/theme/variables/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
export { colors } from './colors'
export { screens } from './screens'
export { spacings } from './spacings'
export { borderRadius } from './borderRadius'
export { zIndex } from './zIndex'
export { fontWeights } from './fontWeights'
export { boxShadows } from './boxShadows'
export { fontSizes } from './fontSizes'
export { keyframes } from './keyframes'
export { lineHeights } from './lineHights'
export { fontWeights } from './fontWeights'
export { borderRadius } from './borderRadius'
13 changes: 0 additions & 13 deletions src/theme/variables/lineHights.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/theme/variables/screens.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/theme/variables/spacings.ts

This file was deleted.

24 changes: 9 additions & 15 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import defaultTheme from 'tailwindcss/defaultTheme'
import type { Config } from 'tailwindcss'
import * as customUtilities from 'eleganceui-tailwind-utilities'
import eleganceUIUtilities from 'eleganceui-tailwind-utilities'

import {
boxShadows,
colors,
keyframes,
zIndex,
spacings,
fontWeights,
fontSizes,
boxShadows,
borderRadius,
screens,
keyframes
} from './src/theme/variables'
import { utilities } from './src/theme/utilities'

const config: Config = {
content: [
Expand All @@ -23,15 +19,9 @@ const config: Config = {
theme: {
extend: {
colors,
screens,
zIndex,
fontWeights,
borderRadius,
fontWeight: fontWeights,
fontSize: fontSizes,
width: { ...defaultTheme.width, ...spacings },
height: { ...defaultTheme.height, ...spacings },
spacing: { ...defaultTheme.spacing, ...spacings },
borderWidth: { ...defaultTheme.borderWidth, ...spacings },
boxShadow: { ...defaultTheme.boxShadow, ...boxShadows },
keyframes: { ...defaultTheme.keyframes, ...keyframes },
fontFamily: {
Expand All @@ -41,10 +31,14 @@ const config: Config = {
...defaultTheme.aspectRatio,
'600/317': '600/317',
'10/7': '10/7'
},
screens: {
...defaultTheme.screens,
xs: '440px'
}
}
},
plugins: [...utilities, ...Object.values(customUtilities)]
plugins: [...eleganceUIUtilities]
}

export default config
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3687,10 +3687,10 @@ electron-to-chromium@^1.4.668:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.673.tgz#1f077d9a095761804aec7ec6346c3f4b69b56534"
integrity sha512-zjqzx4N7xGdl5468G+vcgzDhaHkaYgVcf9MqgexcTqsl2UHSCmOj/Bi3HAprg4BZCpC7HyD8a6nZl6QAZf72gw==

eleganceui-tailwind-utilities@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eleganceui-tailwind-utilities/-/eleganceui-tailwind-utilities-2.1.0.tgz#4bccbd3656c1faea2163e94420d2a52182f0e5f6"
integrity sha512-8TqlVgXjrkydIoCyQfA4n1SdP7SQP4rwNLCHGYgoi4oxxEyLrua2yNhyAv4HCD+mJZAFFRC1wBRTqXs4A6Lb4w==
eleganceui-tailwind-utilities@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/eleganceui-tailwind-utilities/-/eleganceui-tailwind-utilities-3.0.0.tgz#0abea7ebc2c06bd1ab0d9a600fe945528bddaee2"
integrity sha512-/M7jpzj5WB+rjK7IIpTkEDtE4gxwQgAUuFJNJ+roJJtt1HUvIM6FLVdHipDGZSulNjmEfY/F7RcV2Ne5+SQc1w==

emoji-regex@^10.3.0:
version "10.3.0"
Expand Down

0 comments on commit bd830e0

Please sign in to comment.