channel-io / bezier-react

React components library that implements Bezier design system.
https://main--62bead1508281287d3c94d25.chromatic.com
Apache License 2.0
231 stars 47 forks source link

Implement hovered color with customFormat of SD #2462

Closed yangwooseong closed 1 month ago

yangwooseong commented 1 month ago

Self Checklist

Related Issue

Summary

Details

As-is

// index.js
exports.tokens = Object.freeze({
  darkTheme: require('./darkTheme'),
  darkThemeHovered: require('./darkThemeHovered'),
  global: require('./global'),
  lightTheme: require('./lightTheme'),
  lightThemeHovered: require('./lightThemeHovered'),
});

// darkThemeHovered.js
module.exports = Object.freeze({
  "color": Object.freeze({
    "alpha-color-dim-black-normal-hovered": Object.freeze({"value":"#14141466","ref":null}),
  })
})

// styles.css
[data-bezier-them="dark"] {
  --alpha-color-dim-black-normal: var(--alpha-color-bg-absolute-black-lighter);
} 
...
[data-bezier-theme="dark"] {
  --alpha-color-dim-black-normal-hovered: #14141466;
}

To-be

// index.js
exports.tokens = Object.freeze({
  darkTheme: require('./darkTheme'),
  global: require('./global'),
  lightTheme: require('./lightTheme'),
});

// darkTheme.js
module.exports = Object.freeze({
  "color": Object.freeze({
    "alpha-color-dim-black-normal": Object.freeze({"value":"#00000066","ref":"alpha-color-bg-absolute-black-lighter"}),
    "alpha-color-dim-black-normal-hovered": Object.freeze({"value":"#14141466"}),
  })
})

// styles.css
[dark-bezier-theme="dark"] {
  --alpha-color-dim-black-normal: var(--alpha-color-bg-absolute-black-lighter);
  --alpha-color-dim-black-normal-hovered: #14141466;
}

Breaking change? (Yes/No)

References

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: ea3e102910acd94c30e19358cc70d307042c3ae3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages | Name | Type | | ---------------------------- | ----- | | @channel.io/bezier-tokens | Patch | | @channel.io/bezier-react | Patch | | @channel.io/stylelint-bezier | Patch | | bezier-figma-plugin | Patch |

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

channeltalk[bot] commented 1 month ago

https://desk.channel.io/#/channels/1/team_chats/groups/1237/6719e5d9bf313f5a3037

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.28%. Comparing base (a8785b3) to head (ea3e102). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2462 +/- ## ======================================= Coverage 83.28% 83.28% ======================================= Files 141 141 Lines 2943 2943 Branches 899 912 +13 ======================================= Hits 2451 2451 Misses 487 487 Partials 5 5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

Chromatic Report

🚀 Congratulations! Your build was successful!

yangwooseong commented 1 month ago

color 토큰이 달라질 때 or hovered color공식이 달라질 때 어떻게 달라지는지 크로마틱 UI test 에서 명시적으로 확인해보면 좋은데 foundation/color가 스토리가 아니라서 테스트에 포함이 안되는 것 같네요. 지금은 빌드 결과를 하나씩 비교해야 해서 의도치 않은 변경을 만들기 쉬운 것 같아요. 스토리로 바꾸는 것은 어떨까요?

이 말 잘 이해를 못했습니다. bezier-react의 color 스토리에 hovered 가 호버 인터랙션 없이 다른 색상과 함께 나열된 것 & 인터랙션이 적용된 것 2개의 스토리를 만들면 좋을 거 같은데, 맞을까요?

넵 그렇게 하면 될거같습니다. 지금은 foundation이 mdx 파일이라 그런지 https://www.chromatic.com/build?appId=62bead1508281287d3c94d25&number=3269&search= 여기에 diff 로 안잡히는게 불편하다는 뜻이었습니다!