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(pie-icons-webc): DSW-1539 Remove :host-context usage for icon sizing #1107

Merged
merged 16 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/few-gifts-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@justeattakeaway/pie-icons-webc": minor
---

[Fixed] - Attempt to resolve icon size issue
kevinrodrigues marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions packages/components/pie-button/src/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ $breakpoint-wide: 768px;
--btn-height--small: 40px;
--btn-height--medium: 48px;
--btn-height--large: 56px;
--btn-icon-display: block;

/**
* Mixin for updating the button styles based on the size passed in.
Expand Down
1 change: 1 addition & 0 deletions packages/components/pie-icon-button/src/iconButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--btn-border-radius: var(--dt-radius-rounded-e);
--btn-bg-color: var(--dt-color-interactive-brand);
--btn-icon-fill: var(--dt-color-content-interactive-primary);
--btn-icon-display: block;

block-size: var(--btn-dimension);
inline-size: var(--btn-dimension);
Expand Down
5 changes: 2 additions & 3 deletions packages/tools/pie-icons-webc/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ const componentSelector = '${kebabCase(name)}';
export class ${name} extends LitElement implements IconProps {
// The following styles make sure that the icon will be sized correctly
static styles = css\`
:host-context(pie-icon-button) svg,
:host-context(pie-button) svg {
display: block;
:host svg {
Copy link
Contributor

@dandel10n dandel10n Dec 21, 2023

Choose a reason for hiding this comment

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

This change will mess up icon size for all our icons making the svg container 24px X 24px. Here is a Link component with an icon as an example:
Screenshot 2023-12-21 at 10 49 26

Copy link
Contributor

Choose a reason for hiding this comment

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

I created a PR for the fix: #1127

display: var(--btn-icon-display);
width: var(--btn-icon-size);
height: var(--btn-icon-size);
}
Expand Down
Loading