본문 바로가기
[css] tailwind fontsize, color 커스텀 하는 법 tailwind 에서 fontsize, color 커스텀 하는 방법입니다. ailwind.config.js 파일에서 아래와 같이 color 추가하면 됩니다. postcss.config.js가 아니라 tailwind.config.js 이니 주의 하세요. 여기서 주의할 점: extend: { .. } extend 객체로 fontsize와 color를 한번 더 감싸줘야 기존 tailwind에서 제공하는 기본 style을 유지하면서 추가할 수 있다. tailwind.config.js 코드 module.exports = { content: [ "./src/**/*.{js,jsx,ts,tsx}", ], theme: { extend: { fontSize: { xs: ['12px', { lineHeight: '18px..
[css] loading bar css with tailwind, 로딩이 필요한 경우 (ft. tailwind) tailwind, css로 작업한 간단한 로딩바입니다. 구현 화면 구현 영상 로딩이 필요한 이유 loading은 보통 결과값이 도출 되기 이전에 몇 초 동안 실행하여 사용자가 대기중 임을 인지할 수 있도록 UX로서 필요합니다. 또한 react에서 비동기로 데이터를 가지고 올 경우, 결과 값에 데이터가 들어오기 전에 화면이 먼저 렌더링 되면서 null값인 상태에 에러를 발생시키므로 결과값에 데이터가 들어오기 전에는 loading을 실행하여 에러를 방지합니다. html css /* spinner */ .loader { border-top-color: #FFE9A4; -webkit-animation: spinner 1.5s linear infinite; animation: spinner 1.5s linear ..
[css] tailwind dialog 창 사용 예제 부모 컴포넌트 const [openAlert, setOpenAlert] = useState(false) const onOpenAlert = () => { setOpenAlert(!openAlert); } 자식 컴포넌트 AlertDialog.tsx import React from 'react'; const AlertDialog = ({ openAlert, onOpenAlert }: any) => { return ( ); }; export default AlertDialog;
[react] 리액트 tailwind 다이얼로그(모달, 팝업) 구현 style 라이브러리, tailwind를 적용하여 모달창 띄우기를 구현합니다. 구현 화면 구현 내용 react, hooks 방식 스타일 라이브러리, tailwind로 스타일 적용 확인 클릭시 다이얼로그 출현 X 버튼, 확인 버튼 클릭시 다이얼로그 화면 사라짐 tailwind로 다이얼로그 구현 부모 컴포넌트 import React, { useState, useContext } from "react"; import ModalAlert from "./ModalAlert"; const Parent = () => { const [openAlert, setOpenAlert] = useState(false); const onModalAlert = () => { setOpenAlert(!openAlert); } ret..
thailwind css 스타일 프레임워크 (ft. 무료 컴포넌트 사이트 제공) tailwind css 무료 사이트 리스트입니다. 실무에서 tailwind를 스타일 프레임워크를 사용하고 있는데, kit 패키지를 구매하지 않고, 무료 배포된 정보를 구글링하여 찾으면서 구현하다 보니 tailwind의 정보가 많아져서 공유하도록 하겠습니다. thailwind cheatsheet 요약표 한 페이지에 모든 클래스이름 정리표입니다. 작업시에 가장 우선적으로 띄워놓는 사이트입니다. umeshmk.github.io/Tailwindcss-cheatsheet/ Tailwindcss-cheatsheet umeshmk.github.io 위의 사이트 보다 더 디테일 한 요약표입니다. 위에 찾는것이 없을 경우, 아래 사이트를 이용합니다. nerdcave.com/tailwind-cheat-sheet Tailw..
반응형