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

fix(icons): use display=block by default and rename 'iconColor' prop to 'color' #637

Merged
merged 5 commits into from
Aug 5, 2020

Conversation

TheSisb
Copy link
Contributor

@TheSisb TheSisb commented Aug 5, 2020

Prior to this PR, icons were defaulting to display="inline-flex". This solved some issues, but created others. Through experience, we've come to realize that making icons display block by default would be most convenient.

  • If you need to inline an icon, you can either wrap it in one of our Layout components (Stack, Flex, etc) and it will just work.
  • If you need to inline it next to text, you can still pass a display prop to override the default block value (i.e.: display="inline")

It's easier to modify the display prop when the icon is inline than when it is a nested child of a Layout component, which is why we're changing the default value (Developer Experience++).
Furthermore, icons are still span elements with the display="block" styled applied, for clearer semantics.

Also, since Box now accepts typography props and, namely color, I've gone ahead and made icons accept color for consistency too (previously iconColor).

BREAKING CHANGE: This change renames a key prop and changes the display mode from inline-flex to block
@vercel
Copy link

vercel bot commented Aug 5, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/twilio-dsys/paste/jzhmwb1cr
✅ Preview: https://paste-git-icon-default-display-block.twilio-dsys.vercel.app

@TheSisb TheSisb self-assigned this Aug 5, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2020

Size Change: -158 B (0%)

Total Size: 423 kB

Filename Size Change
packages/paste-core/components/alert/dist/index.es.js 2.73 kB -6 B (0%)
packages/paste-core/components/alert/dist/index.js 2.31 kB -5 B (0%)
packages/paste-core/components/combobox/dist/index.es.js 3.14 kB -6 B (0%)
packages/paste-core/components/combobox/dist/index.js 2.74 kB -3 B (0%)
packages/paste-core/components/disclosure/dist/index.es.js 2.31 kB -3 B (0%)
packages/paste-core/components/disclosure/dist/index.js 1.91 kB -3 B (0%)
packages/paste-core/components/form/dist/index.es.js 8.68 kB -9 B (0%)
packages/paste-core/components/form/dist/index.js 8.28 kB -11 B (0%)
packages/paste-core/components/menu/dist/index.es.js 2.38 kB -8 B (0%)
packages/paste-core/components/menu/dist/index.js 2.01 kB -7 B (0%)
packages/paste-core/components/modal/dist/index.es.js 2.87 kB -3 B (0%)
packages/paste-core/components/modal/dist/index.js 2.44 kB -3 B (0%)
packages/paste-core/components/popover/dist/index.es.js 2.13 kB -8 B (0%)
packages/paste-core/components/popover/dist/index.js 1.73 kB -7 B (0%)
packages/paste-core/components/spinner/dist/index.es.js 1.92 kB -6 B (0%)
packages/paste-core/components/spinner/dist/index.js 1.46 kB -4 B (0%)
packages/paste-core/core-bundle/dist/index.es.js 44.6 kB -32 B (0%)
packages/paste-core/core-bundle/dist/index.js 44.9 kB -34 B (0%)
ℹ️ View Unchanged
Filename Size Change
packages/paste-core/components/anchor/dist/index.es.js 1.06 kB 0 B
packages/paste-core/components/anchor/dist/index.js 663 B 0 B
packages/paste-core/components/avatar/dist/index.es.js 1.46 kB 0 B
packages/paste-core/components/avatar/dist/index.js 1.06 kB 0 B
packages/paste-core/components/button/dist/index.es.js 3.89 kB 0 B
packages/paste-core/components/button/dist/index.js 3.5 kB 0 B
packages/paste-core/components/card/dist/index.es.js 1.1 kB 0 B
packages/paste-core/components/card/dist/index.js 715 B 0 B
packages/paste-core/components/heading/dist/index.es.js 1.22 kB 0 B
packages/paste-core/components/heading/dist/index.js 825 B 0 B
packages/paste-core/components/list/dist/index.es.js 1.16 kB 0 B
packages/paste-core/components/list/dist/index.js 765 B 0 B
packages/paste-core/components/paragraph/dist/index.es.js 237 B 0 B
packages/paste-core/components/paragraph/dist/index.js 278 B 0 B
packages/paste-core/components/screen-reader-only/dist/index.es.js 711 B 0 B
packages/paste-core/components/screen-reader-only/dist/index.js 322 B 0 B
packages/paste-core/components/separator/dist/index.es.js 1.12 kB 0 B
packages/paste-core/components/separator/dist/index.js 733 B 0 B
packages/paste-core/components/tabs/dist/index.es.js 2.17 kB 0 B
packages/paste-core/components/tabs/dist/index.js 1.75 kB 0 B
packages/paste-core/components/tooltip/dist/index.es.js 1.42 kB 0 B
packages/paste-core/components/tooltip/dist/index.js 1 kB 0 B
packages/paste-core/components/truncate/dist/index.es.js 666 B 0 B
packages/paste-core/components/truncate/dist/index.js 279 B 0 B
packages/paste-core/components/typography/dist/index.es.js 1.57 kB 0 B
packages/paste-core/components/typography/dist/index.js 1.57 kB 0 B
packages/paste-core/layout/absolute/dist/index.es.js 470 B 0 B
packages/paste-core/layout/absolute/dist/index.js 492 B 0 B
packages/paste-core/layout/aspect-ratio/dist/index.es.js 1.03 kB 0 B
packages/paste-core/layout/aspect-ratio/dist/index.js 628 B 0 B
packages/paste-core/layout/flex/dist/index.es.js 1.81 kB 0 B
packages/paste-core/layout/flex/dist/index.js 1.4 kB 0 B
packages/paste-core/layout/grid/dist/index.es.js 1.61 kB 0 B
packages/paste-core/layout/grid/dist/index.js 1.17 kB 0 B
packages/paste-core/layout/media-object/dist/index.es.js 508 B 0 B
packages/paste-core/layout/media-object/dist/index.js 544 B 0 B
packages/paste-core/layout/stack/dist/index.es.js 1.31 kB 0 B
packages/paste-core/layout/stack/dist/index.js 912 B 0 B
packages/paste-core/primitives/box/dist/index.es.js 2.3 kB 0 B
packages/paste-core/primitives/box/dist/index.js 2.26 kB 0 B
packages/paste-core/primitives/combobox/dist/index.es.js 105 B 0 B
packages/paste-core/primitives/combobox/dist/index.js 224 B 0 B
packages/paste-core/primitives/disclosure/dist/index.es.js 120 B 0 B
packages/paste-core/primitives/disclosure/dist/index.js 208 B 0 B
packages/paste-core/primitives/menu/dist/index.es.js 165 B 0 B
packages/paste-core/primitives/menu/dist/index.js 260 B 0 B
packages/paste-core/primitives/modal-dialog/dist/index.es.js 14.2 kB 0 B
packages/paste-core/primitives/modal-dialog/dist/index.js 14.2 kB 0 B
packages/paste-core/primitives/non-modal-dialog/dist/index.es.js 141 B 0 B
packages/paste-core/primitives/non-modal-dialog/dist/index.js 228 B 0 B
packages/paste-core/primitives/tabs/dist/index.es.js 121 B 0 B
packages/paste-core/primitives/tabs/dist/index.js 211 B 0 B
packages/paste-core/primitives/text/dist/index.es.js 1.63 kB 0 B
packages/paste-core/primitives/text/dist/index.js 1.62 kB 0 B
packages/paste-core/primitives/tooltip/dist/index.es.js 129 B 0 B
packages/paste-core/primitives/tooltip/dist/index.js 218 B 0 B
packages/paste-design-tokens/dist/tokens.common.js 2.83 kB 0 B
packages/paste-design-tokens/dist/tokens.es6.js 2.78 kB 0 B
packages/paste-libraries/animation/dist/index.es.js 16.7 kB 0 B
packages/paste-libraries/animation/dist/index.js 16.7 kB 0 B
packages/paste-libraries/dropdown/dist/index.es.js 17.7 kB 0 B
packages/paste-libraries/dropdown/dist/index.js 17.7 kB 0 B
packages/paste-libraries/reakit/dist/index.es.js 28.2 kB 0 B
packages/paste-libraries/reakit/dist/index.js 27.7 kB 0 B
packages/paste-libraries/styling/dist/index.es.js 29.6 kB 0 B
packages/paste-libraries/styling/dist/index.js 30 kB 0 B
packages/paste-style-props/dist/index.es.js 2 kB 0 B
packages/paste-style-props/dist/index.js 2.03 kB 0 B
packages/paste-theme/dist/index.es.js 4.73 kB 0 B
packages/paste-theme/dist/index.js 4.29 kB 0 B
packages/paste-types/dist/index.es.js 21 B 0 B
packages/paste-types/dist/index.js 34 B 0 B

compressed-size-action

Co-authored-by: Rich Bachman <rb@richbachman.com>
@vercel vercel bot temporarily deployed to Preview August 5, 2020 17:59 Inactive
Co-authored-by: Rich Bachman <rb@richbachman.com>
@TheSisb TheSisb merged commit 82beef4 into main Aug 5, 2020
@TheSisb TheSisb deleted the icon/default-display-block branch August 5, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants