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: apply size to style directly to prevent warnings on size #901

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

SeDemal
Copy link
Collaborator

@SeDemal SeDemal commented Aug 1, 2024

Settings tabler icons-react SVG's size parameter using relative units causes warning in console.
Use style instead. (Only affects SVG/icons)

@SeDemal SeDemal requested a review from a team as a code owner August 1, 2024 23:14
@SeDemal SeDemal force-pushed the fix/relative-sized-icons-warnings branch from b293783 to 7a144d7 Compare August 1, 2024 23:18
@@ -66,7 +66,7 @@ export default function RssFeed({ serverData, options }: WidgetComponentProps<"r

const InfoDisplay = ({ date }: { date: string }) => (
<Group gap="2.5cqmin">
<IconClock size="2.5cqmin" />
<IconClock style={{ height: "3cqmin", width: "3cqmin" }} />
Copy link
Member

Choose a reason for hiding this comment

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

Can you provide more context why size doesn't work here and why you use the style attribute instead of height and width directly?

Copy link
Collaborator Author

@SeDemal SeDemal Aug 4, 2024

Choose a reason for hiding this comment

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

SVG's don't officially support relative sizing, says so in it's spec. Browsers knows that, found it stupid and allows for relative sizing when using the component, but because it's not supposed to support it, it'll flood an error in the console of the browser. so to circumvent that, you need to set the size using the style parameter, which is anoying, especially since the size parameter exist but you just can't use it properly without it making a mess in the browser's logs. (Tabler icons directly apply the size parameter to the height/width parameter of the underlying icon svg, instead of passing it to the styling, so only icons are affected and need to be changed)

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we contribute this fix upstream then? (eg. Tabler Icons?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah... I agree, just out of laziness I didn't want to bother. But since I don't know how long this will take, and I don't want my console to be flooded, I'd suggest we do this in the meantime.

Copy link

deepsource-io bot commented Aug 8, 2024

Here's the code health analysis summary for commits f9e2df0..d85e261. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

github-actions bot commented Aug 8, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 41.05% 11261 / 27427
🔵 Statements 41.05% 11261 / 27427
🔵 Functions 38.06% 276 / 725
🔵 Branches 72.73% 1067 / 1467
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/widgets/src/dns-hole/summary/component.tsx 0% 0% 0% 0% 1, 3, 5-7, 10, 12-13, 17, 19-24, 26-28, 30, 32-37, 39, 41-85, 99-102, 104-114, 116-123, 125-135, 137-143, 145-147, 149, 151-160, 162-168
packages/widgets/src/rssFeed/component.tsx 0% 0% 0% 0% 1-4, 7, 9-12, 14-24, 26-38, 40-41, 44-55, 58-63, 65, 67-73
packages/widgets/src/weather/component.tsx 0% 0% 0% 0% 1-4, 7, 10, 12-23, 25-28, 30, 32, 34, 40-73, 75, 77, 79-90, 92-106, 108, 110-123, 125-140, 142, 144-145
packages/widgets/src/weather/icon.tsx 0% 0% 0% 0% 1, 11-12, 15, 29-30, 32-33, 51-53, 55, 57-59, 61-77, 79, 100-114, 116-119
Generated in workflow #2498

@Meierschlumpf
Copy link
Member

What is the state of this pr @SeDemal @manuel-rw ?

@manuel-rw
Copy link
Member

I still think that we should contribute upstream. My opinion hasn't changed

@SeDemal
Copy link
Collaborator Author

SeDemal commented Sep 17, 2024

Leave as a keepsake that we need to do it at some point.

@Meierschlumpf Meierschlumpf force-pushed the dev branch 2 times, most recently from 09ac2bf to c37a0e3 Compare October 23, 2024 15:30
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.

3 participants