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: uploaded svg icon not showing #3179

Merged
merged 24 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
beb220a
fix: add prio for fill
Arukuen May 6, 2024
3f2d8a1
fix: add prio for fill of arrow in carousel
Arukuen May 6, 2024
adb6957
fix: add prio by using fill in path in map block
Arukuen May 7, 2024
da6db7b
fix: remove custom width and height to allow stackable to adjust it
Arukuen May 8, 2024
c67bdd2
fix: add !important to fill and color to have prio over inline
Arukuen May 8, 2024
4a75f0b
fix: only remove width/height in SVG; support for double and single q…
Arukuen May 12, 2024
9fb0b79
fix: add support for common svg shapes
Arukuen May 12, 2024
95b3717
fix: add support for common svg shapes in carousel
Arukuen May 12, 2024
e6babe1
fix: add support for common svg shapes in map
Arukuen May 12, 2024
57851c1
fix: remove manual setting of fill (default to black if no color is s…
Arukuen May 12, 2024
66b2f2e
fix: add prio for fill
Arukuen May 6, 2024
afec6c3
fix: add prio for fill of arrow in carousel
Arukuen May 6, 2024
d6594b2
fix: add prio by using fill in path in map block
Arukuen May 7, 2024
78164a6
fix: remove custom width and height to allow stackable to adjust it
Arukuen May 8, 2024
e025c4c
fix: add !important to fill and color to have prio over inline
Arukuen May 8, 2024
ee1e376
fix: only remove width/height in SVG; support for double and single q…
Arukuen May 12, 2024
ef7c6a9
fix: add support for common svg shapes
Arukuen May 12, 2024
3e388e4
fix: add support for common svg shapes in carousel
Arukuen May 12, 2024
58e7fef
fix: add support for common svg shapes in map
Arukuen May 12, 2024
5fc35e6
fix: remove manual setting of fill (default to black if no color is s…
Arukuen May 12, 2024
f1cfccb
fix: deprecation
Arukuen May 27, 2024
2632172
fix: deprecation
Arukuen May 27, 2024
6454c0b
fix: remove deprecated code
Arukuen May 27, 2024
43dcf94
fix: handle deprecation in depracated.js
Arukuen Jun 7, 2024
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
9 changes: 9 additions & 0 deletions src/block/carousel/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ const Styles = props => {
key="arrowIconColor"
hover="all"
/>
<BlockCss
{ ...propsToPass }
selector=".stk-block-carousel__button svg.ugb-custom-icon path"
hoverSelector=".stk-block-carousel__button svg.ugb-custom-icon path:hover"
styleRule="fill"
attrName="arrowIconColor"
key="arrowIconColor"
hover="all"
/>
<BlockCss
{ ...propsToPass }
styleRule="--button-width"
Expand Down
6 changes: 6 additions & 0 deletions src/block/icon-list-item/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
border-width: 1px;
border-color: rgba(0, 0, 0, 0.4);
}

// Apply the color to the SVG path on the defintion
svg.ugb-custom-icon path {
fill: var(--stk-icon-list-marker-color);
color: var(--stk-icon-list-marker-color);
}
}

.stk-block-icon-list-item__content {
Expand Down
6 changes: 6 additions & 0 deletions src/block/map/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export const getIconOptions = attributes => {
svgEl.setAttribute( 'style', `color: ${ iconColor1 || DEFAULT_ICON_COLOR }; opacity: ${ iconOpacity || iconOpacity === 0 ? parseFloat( iconOpacity, 10 ) : DEFAULT_ICON_OPACITY }` )
svgEl.setAttribute( 'transform', `rotate(${ iconRotation || iconRotation === 0 ? parseInt( iconRotation, 10 ) : DEFAULT_ICON_ROTATION })` )

// Apply the fill directly to the path elements
const pathElements = svgEl.querySelectorAll( 'path' )
pathElements.forEach( pathElement => {
pathElement.setAttribute( 'style', `fill: ${ iconColor1 || DEFAULT_ICON_COLOR }; color: ${ iconColor1 || DEFAULT_ICON_COLOR }; opacity: ${ iconOpacity || iconOpacity === 0 ? parseFloat( iconOpacity, 10 ) : DEFAULT_ICON_OPACITY }` )
} )

const serializedString = new XMLSerializer().serializeToString( svgEl ) //eslint-disable-line no-undef
const iconUrl = `data:image/svg+xml;base64,${ window.btoa( serializedString ) }`
const iconOptions = { url: iconUrl }
Expand Down
Loading