-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: vanilla-extract 추가 #7
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const { createVanillaExtractPlugin } = require("@vanilla-extract/next-plugin"); | ||
const withVanillaExtract = createVanillaExtractPlugin(); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
const config = withVanillaExtract(nextConfig); | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { style, styleVariants } from "@vanilla-extract/css"; | ||
|
||
const base = style({ color: "white" }); | ||
export const variant = styleVariants({ | ||
primary: [base, { background: "blue" }], | ||
secondary: [base, { background: "red" }], | ||
}); | ||
|
||
// 배열로 합성 가능 | ||
export const nextButton = style([ | ||
variant.primary, | ||
{ | ||
padding: "8px 14px", | ||
borderRadius: 50, | ||
backgroundColor: "none", | ||
border: "1px solid black", | ||
}, | ||
]); | ||
|
||
export const addButton = style([ | ||
variant.secondary, | ||
{ | ||
padding: "8px 14px", | ||
borderRadius: 50, | ||
backgroundColor: "none", | ||
border: "1px solid black", | ||
}, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { globalStyle } from "@vanilla-extract/css"; | ||
|
||
globalStyle("html, body", { | ||
backgroundColor: "rgb(100,100,100)", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classNames or clsx도 설치해야되지 않나
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p2)
recipe
활용하거나 배열로 합성 가능해서 크게 상관없을수도 있겠다는 생각도 드는데, 요소에 id나 class를 사용하는 경우 때문에 그런가??There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p2) recipe 사용법 찾아보니까, 설치 안해도 되겠다.
근데 useState 같은 상태에 따라 스타일이 동적으로 변하게 될 경우
이렇게 작성될텐데, 이러면 스타일에 상태 전달을 해야 돼서, 스타일쪽에서 넘겨 받는 상태값이 많아질수록 변수 관리가
복잡해지고, 버튼처럼 공통 컴포넌트로 만든다고 해도 각자 작업하는 컴포넌트에서 사용할 때 넘겨주는 useState 변수명을 팀 내 컨벤션으로 다같이 맞춰야 하는건가?
그리고 매번 recipe를 작성 하는건 공수가 크니까 디자인팀에도 최대한 컴포넌트 재사용 할 수 있게 일관된 디자인 가이드로 신경써서 만들어달라고 해야되겠네 (사실 잘 모름 맞나?)
@hjy0951 @thwjddlqslek @qkrdmstlr3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 지금 당장은 상태에 따른 스타일링이 많이 들어갈까 싶기는 한데, 내일 같이 이야기해봐도 좋겠다
나는 사실 버튼이나 타이포 등등 공통 컴포넌트는 상태에 따른 스타일링이 어느 정도 범위가 정해져있다고 생각해서 크게 문제 없을 거라고 생각했었어!
우선 변수명 같은 경우에는 크게 컨벤션을 정하거나 할 필요는 없는 것 같은게 객체에 key-value로 값을 넣어주는거라
{ isActive: isClicked }
같이 이런 방식으로 넣어주면 괜찮지 않을까?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나는 초기 단계에서 재사용성을 고려하긴 어려울 것 같고, 우리가 맞춰야 하지 않을까라는 생각이야