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

feat(dropdown-item): update spacing of icons #9330

Merged
merged 8 commits into from
May 17, 2024

Conversation

anveshmekala
Copy link
Contributor

@anveshmekala anveshmekala commented May 14, 2024

Related Issue: #7095

Summary

Updates spacing of icons in calcite-dropdown-item.

@anveshmekala anveshmekala requested a review from a team as a code owner May 14, 2024 04:49
@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label May 14, 2024
@jcfranco jcfranco added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 14, 2024
@jcfranco jcfranco changed the title feat(dropdown-item): updates spacing of icons feat(dropdown-item): update spacing of icons May 14, 2024
@anveshmekala anveshmekala marked this pull request as draft May 14, 2024 20:39
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 14, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 14, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 14, 2024
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 15, 2024
@@ -1,9 +1,9 @@
export const CSS = {
container: "container",
containerNone: "container--none-selection",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SideNote: Sorting is handled in a followup refactor PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anveshmekala anveshmekala marked this pull request as ready for review May 15, 2024 15:55
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 15, 2024
@ashetland
Copy link

Lookin' gewd!

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨🏆✨

@@ -125,7 +125,7 @@ export class DropdownItem implements InteractiveComponent, LoadableComponent {
*
* @internal
*/
@Prop() scale: Scale = "m";
@Prop({ reflect: true }) scale: Scale = "m";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per our conversation, let's discuss reflection of internal properties as a pattern, as it simplifies styling without significant trade-offs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reflecting @internal props for styling purposes will help us improves the maintainability and readability of styles. Though it's internal since they aren't document for public use it is safe to reflect and take advantage of the attribute selector in CSS instead of creating dynamic classes.

Considering this PR as example, reflecting prop helped us avoid cumbersome styling code and there are other instance in the repo where internal props are reflected. We can use this as a pattern if the reflection helps improving the code without affecting UI/UX.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah its a trade off discussion...

Is showing an undocumented attribute terrible? No.
Is not showing an undocumented attribute better? Probably.

So its really about if its worth the work to use an internal shadow DOM class vs relying on an attribute.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So its really about if its worth the work to use an internal shadow DOM class vs relying on an attribute.

Agreed. From what I've seen, the extra work of adding root container classes to mimic host and reflected internal attributes (e.g., scale-related styling) can feel like overkill. Since we usually avoid reflecting props on the host element, leveraging the reflection of internal properties seems simpler and cleaner in this case.

@anveshmekala anveshmekala merged commit c2e5a99 into main May 17, 2024
13 checks passed
@anveshmekala anveshmekala deleted the anveshmekala/7095-dropdown-update-icon-spacing branch May 17, 2024 05:38
anveshmekala added a commit that referenced this pull request May 17, 2024
**Related Issue:** # N/A

## Summary

Removes unused CSS classes.

_Note_: Suggested to install after
#9330
benelan added a commit that referenced this pull request May 17, 2024
…otfix-release

* origin/main:
  chore: release next
  feat(table): Add `selection-display` property (#9355)
  refactor(dropdown-item):  remove unused css classes (#9349)
  chore: release next
  feat(dropdown-item): update spacing of icons (#9330)
  chore: release next
  feat(flow-item): add content-top slot (#9344)
  chore: release next
  feat(flow-item): add content-bottom slot (#9346)
  chore: release next
  fix(input, input-number, input-text): ensure autofocus is available on HTMLElement (#9343) (#9347)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants