Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [LINKER-23] vanilla extract global style 설정 #8

Merged
merged 9 commits into from
Dec 14, 2023

Conversation

JjungminLee
Copy link
Collaborator

작업 내용

반영 화면

image

아래 작은 LINKER 텍스트가 버튼인데 reset 설정을 해서 반영이 된것을 확인할 수 있었습니다!

궁금한점

@useonglee

  • 저는 작업을 할 때 _app.tsx 를 두고 거기에 react-query,recoil,global style들을 적용하는데 클론 받고 보니까 layout.tsx가 있어서 우선 여기에 전역 스타일링 작업을 했어요 제가 한게 맞는지 모르겠어서 한번 봐주시면 감사하겠습니다 !
  • vanilla extract 문서를 보니까 theme class가 있는데 이게 디자인 시스템들을 모아놓는 것 같아요! 혹시 이걸 자주 쓰나요?! 이걸 자주 쓰면 이렇게 하고 그게 아니면 scss방식으로 작업해도 괜찮을지 여쭙고 싶어요..!

@JjungminLee
Copy link
Collaborator Author

허걱 제가 작업을 하다 ts 버전을 바꿔버린것 같아요..ㅜ 다시 낮춰놓을게요 yarn berry를 처음 써봐서 vs code에 이것저것 설정해줄게 있더라구요 그거 만지다가 저렇게 된것 같습니다!

@@ -1,5 +1,6 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import { GlobalStyle } from './constants/style.css';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import './constants/style.css';

밑에 className 코드 제거하고, 요렇게는 적용 안되나요!?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 저렇게 바꿔둘게요!

Comment on lines +1 to +31
import { globalStyle } from '@vanilla-extract/css';

export const GlobalStyle = [
globalStyle('html, body', {
margin: 0,
padding: 0,
overflowX: 'hidden',
height: '100%',
}),
globalStyle('*, *:before, *:after', {
boxSizing: 'border-box',
}),
globalStyle('focus', {
outline: 'none',
border: 'none',
}),
globalStyle('button', {
background: 'none',
padding: 0,
border: 'none',
cursor: 'pointer',
}),
globalStyle('a', {
color: 'inherit',
textDecoration: 'none',
cursor: 'pointer',
}),
globalStyle('table', { borderCollapse: 'collapse', borderSpacing: 0 }),

globalStyle('img, picture, video, canvas, svg ', { display: 'block', maxWidth: '100%' }),
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app 폴더말고 src/styles/global.css.ts 형태의 구조로 가면 좋을 것 같아요!

Comment on lines +4 to +9
globalStyle('html, body', {
margin: 0,
padding: 0,
overflowX: 'hidden',
height: '100%',
}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://necolas.github.io/normalize.css/8.0.1/normalize.css

styles/normalize.css 파일 만들어서 위에 코드 복붙하고, 저기서 제공되지 않는 것들만 추가로 global.css.ts 파일만들어서 해봐도 좋을 것 같아요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global style 의 html, body에 아래 코드 추가 부탁드려도 될까요!?

html {
  /* 62.5% of the base size of 16px = 10px.*/
  font-size: 62.5%;
  }

body {
  font-size: 1.6rem;
  }

https://yozm.wishket.com/magazine/detail/1410/

저희 웹앱 서비스만들때 rem으로 사용했으면 좋겠다고 생각해서입니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 넣어둘게요!

@useonglee
Copy link
Member

useonglee commented Dec 10, 2023

전역으로 사용하는 스타일, 타입 등만 src/* 구조로 가고, src/app/* 에서의 구조는 아래 링크 참고해서 해봐도 괜찮을 것 같은데, 어떻게 생각하시나요!?

https://vercel.com/guides/nextjs-multi-tenant-application

@JjungminLee
Copy link
Collaborator Author

전역으로 사용하는 스타일, 타입 등만 src/* 구조로 가고, src/app/* 에서의 구조는 아래 링크 참고해서 해봐도 괜찮을 것 같은데, 어떻게 생각하시나요!?

https://vercel.com/guides/nextjs-multi-tenant-application
넵 좋아요! 생각해보니까 13버전이니까 저렇게 쓰는게 맞을것 같아요!

@useonglee useonglee removed the Epic label Dec 10, 2023
@useonglee
Copy link
Member

에픽이 아니라서 라벨 제거했어요! 🙇‍♂️
지라 기준으로 에픽 이슈 티켓 생성하게 되면 그 때 Epic 라벨 사용하시면 될 것 같습니다!!

useonglee
useonglee previously approved these changes Dec 14, 2023
@useonglee useonglee merged commit 5b08000 into develop Dec 14, 2023
4 checks passed
@useonglee useonglee deleted the feat/LINKER-23_global-style branch December 14, 2023 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants