// cannot be used as a JSX component
@types/react, @types/react-dom에 대한 참조가 잘못되면서 발생하는 이슈
Footnotes
-
cli를 사용할 경우
CHROMATIC_PROJECT_TOKEN을.env에서 관리하면 된다 ↩
# 아마도 git을 사용하고 있을테니까 `git mv`를 사용해서 변경해주자
find src -type f | grep "\.[jt]s$" | xargs -n1 grep -HE "^[^*\n]*(<\/?[a-zA-Z]*>)[\s\w]*$" | cut -d: -f1 | uniq | awk '{print "git mv "$1" "$1"x"}' | sh
Footnotes
<div
dangerouslySetInnerHTML={{
__html: `
<img src="http://unsplash.it/100/100?random" onload="console.log('you got hacked');" />
`,
}}
/>
가끔 아주 가끔 이상한 일을 해야할때가 있는데 그럴때는 이렇게 하면 된다.
const obj = {
a: 1,
b: 2,
}
console.log(obj[['a']]) // 1
console.log(obj[['b']]) // 2
이게 되네 🤔
# .gitignore가 규칙이 적용되지 않을때
git rm -rf --cached .
git add .
GitHub - meltingice/psd.js: A Photoshop PSD file parser for NodeJS and browsers
psd 파서. 이를 통해 관리 가능한 트리 구조에서 Photoshop 문서로 작업하고 다음과 같은 중요한 데이터를 찾을 수 있습니다.
- 문서 구조
- 문서 크기
- 레이어/폴더 크기 + 위치 지정
- 레이어/폴더 이름
- 레이어/폴더 가시성 및 불투명도
- 글꼴 데이터( psd-enginedata 를 통해 )
- 텍스트 영역 내용
- 글꼴 이름, 크기 및 색상
- 색상 모드 및 비트 심도
- 벡터 마스크 데이터
- 병합된 이미지 데이터
- 레이어 구성 요소
- A Variable Fonts Primer
- Google Fonts
- Getting the Most Out of Variable Fonts on Google Fonts | CSS-Tricks
- Variable Fonts for Developers
- Using CSS Custom Properties to Adjust Variable Font Weights in Dark Mode | CSS-Tricks1
Footnotes
-
다크모드에서 weight가 시각적으로 차이가 날수 있기때문에 그럴경우 변수로 분리해서 대응하는 방법 ↩
- 5 steps to faster web fonts /// Iain Bean
- How to Stop Lighthouse Complaining About Render Blocking Google Fonts | Codeboosh
- A Comprehensive Guide to Font Loading Strategies—zachleat.com
- How to avoid layout shifts caused by web fonts – Simon Hearne
- The Fastest Google Fonts – CSS Wizardry – Web Performance Optimisation
- Time to Say Goodbye to Google Fonts
- The Best Font Loading Strategies and How to Execute Them | CSS-Tricks
요약하자면
- woff2
- font-display로 레이아웃 이슈 최소화
- preload
- self (feat. google webfonts helper)
몇몇 권장사항은 한글 폰트에서는 사실상 불가능한 부분이라 가능한 부분들을 적용하면 된다.