테일윈드와 import 관련 추천 플러그인

2023. 12. 10. 14:14프론트엔드

반응형

Automatic Class Sorting with Prettier

<!-- Before --> 
<button class="text-white px-4 sm:px-8 py-2 sm:py-3 bg-sky-700 hover:bg-sky-800">...</button> 

<!-- After --> 
<button class="bg-sky-700 px-4 py-2 text-white hover:bg-sky-800 sm:px-8 sm:py-3">...</button>

설치

  1. 터미널 명령어 이용하여 설치
npm install -D prettier prettier-plugin-tailwindcss
  1. Prettier Configuration file을 생성하여 플러그인 추가
// .prettierrc.json
{ "plugins": ["prettier-plugin-tailwindcss"] }

tailwindcss/typography

  • 공식문서 : https://tailwindcss.com/docs/typography-plugin
  • 테일윈드 공식 typography 플러그인으로, prose 클래스를 사용하여 타이포그래피를 조절할 수 있다.
  • 예를 들어, <h1>, <h2>, <p>, <ul>, <ol> 등의 HTML 태그에 대한 스타일을 적용할 수 있다.

설치

  1. 터미널 명령어 이용하여 설치
npm install -D @tailwindcss/typography
  1. tailwind.config.js 파일에 추가
/** @type {import('tailwindcss').Config} */ 
module.exports = {
	theme: { 
		// ...
	 },
	plugins: [ 
		require('@tailwindcss/typography'), 
		// ...
	],
}

eslint-plugin-import

설치

npm install eslint-plugin-import --save-dev
반응형