-
Notifications
You must be signed in to change notification settings - Fork 52
Add truncated prop to Text component
#1103
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
Add truncated prop to Text component
#1103
Conversation
🦋 Changeset detectedLatest commit: 152ee52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Chromatic Report🚀 Congratulations! Your build was successful! |
Codecov ReportBase: 72.61% // Head: 72.60% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## next-v1 #1103 +/- ##
===========================================
- Coverage 72.61% 72.60% -0.01%
===========================================
Files 237 237
Lines 3137 3136 -1
Branches 853 854 +1
===========================================
- Hits 2278 2277 -1
Misses 728 728
Partials 131 131
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
truncated prop to Text component
|
채널 웹 데스크 어플리케이션에 로컬 빌드 적용하셔서 테스트 한 번 부탁드립니다! |
guswnsxodlf
left a comment
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.
truncate 여부에 상관 없이 block 혹은 inline-block을 주는 방법은 안되는 걸까요?
웹 데스크에서 Text + ellipsis() 사용처에서 전반적으로 확인해본 결과 잘 적용됩니다! |
#487 에서 예기치 못하게 inline -> block 속성으로 변경되어서 문제가 되었던 히스토리가 있어서, |
| }) | ||
|
|
||
| it('Text receives bold style', () => { | ||
| it('Text receives italic style', () => { |
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.
👍
Self Checklist
CODEOWNERSfile.Related Issue
Fixes #629
Summary
Text컴포넌트에truncated속성을 추가합니다.Details
현재 베지어 Text 컴포넌트는
span(inline 엘리먼트)을 사용하고 있습니다. inline 엘리먼트에서는text-overflow속성을 제대로 적용할 수 없습니다.(inline 엘리먼트는 너비를 가지지 않고 컨텐츠 크기만큼 공간을 차지함)따라서,
truncated옵션을 주었을 때text-overflow가 제대로 적용될 수 있도록display: block속성도 추가하였습니다.(고민되는 부분)
display: block속성을 추가하는 것에 있어block이라는 prop을 하나 더 열어주고, 말줄임 속성을 적용하고 싶으면block,truncated를 둘 다 적용하는 방식이 더 명확하게 display 속성이 block으로 변화되는 것을 알 수 있다는 생각이 들었습니다.(Text의 display: flex 삭제 #487 에서 예기치 못하게 inline -> block 속성으로 변경되어서 문제가 된 적이 있기 때문에)
하지만 사용처에서 항상
block,trucated를 같이 적용해야한다는 불편함과,truncated단독으로 옵션을 주었을 때는 말줄임이 제대로 적용되지 않기 때문에 같이 스타일링 하는 것으로 작성하였습니다.span(inline 엘리먼트)과 함께truncated속성을 사용하는 경우에는display: blockorinline-block이 포함된 경우가 많음다만, 현재 Text props 중
marginTop,marginBottom,marginVertical속성은 별도의display: blockorinline-block스타일링을 주고있지 않다면 margin이 제대로 적용되지 않고 있기 때문에,blockprop을 하나 더 열어주고 필요할 때 사용해도 좋을것 같다는 생각입니다.truncated 스타일에
display: block이 포함되지 않은 사례div태그), Link 컴포넌트(default가a태그), Link 사용처div태그)truncated 스타일에
display: block이 포함된 사례span태그)span태그)데스크에 적용된 후에, 후속으로 데스크 Text ellipsis 관련 스타일링 코드를 마이그레이션 할 예정입니다.
Breaking change or not (Yes/No)
No
References