Skip to content

Commit

Permalink
fix(Brand): move styling props to img instead of picture (#5079)
Browse files Browse the repository at this point in the history
* fix(Brand): move classNameOverride to img instead of picture

* fix(Brand): move style to img instead of picture

* fix(Workflow): fix Brand size
  • Loading branch information
HeartSquared authored Sep 26, 2024
1 parent 97bf6b3 commit da4e513
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-ghosts-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/components": patch
---

Fix Brand styling props to be on the `<img>` instead of `<picture>`
8 changes: 5 additions & 3 deletions packages/components/src/Brand/Brand.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { HTMLAttributes, SVGAttributes } from "react"
import classnames from "classnames"
import { OverrideClassName } from "~components/types/OverrideClassName"
import { assetUrl } from "~components/utils/hostedAssets"
import { BrandCollectiveIntelligence } from "./BrandCollectiveIntelligence"
Expand Down Expand Up @@ -58,11 +59,11 @@ export const Brand = ({
)
}

const { alt, classNameOverride, ...otherProps } = restProps
const { alt, classNameOverride, style, ...otherProps } = restProps
const brandTheme = reversed ? "-reversed" : "-default"

return (
<picture className={classNameOverride} {...otherProps}>
<picture {...otherProps}>
<source
srcSet={assetUrl(`brand/${variant}-reversed.svg`)}
media="(forced-colors: active) and (prefers-color-scheme: dark)"
Expand All @@ -74,7 +75,8 @@ export const Brand = ({
<img
src={assetUrl(`brand/${variant}${brandTheme}.svg`)}
alt={alt}
className={styles.img}
className={classnames(styles.img, classNameOverride)}
style={style}
/>
</picture>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
.branding {
justify-content: center;
grid-area: branding;
display: flex;
flex-grow: 1;
justify-content: center;
padding-top: var(--spacing-4);

@media (width >= 768px) {
@media (width >=768px) {
justify-content: unset;
}
}

.logo {
flex-basis: 7.5rem;
width: 7.5rem;
}

0 comments on commit da4e513

Please sign in to comment.