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(icons-react): update svg code to remove breaking style attribute #16736

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

alisonjoseph
Copy link
Member

@alisonjoseph alisonjoseph commented Jun 11, 2024

Closes carbon-design-system/carbon-website#4096

Changelog

  • cleanup SVG code to remove isolation: isolate;

Testing / Reviewing

Icons should look visually identical

Copy link

netlify bot commented Jun 11, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit df2b6dd
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6668901bbfeb100008809ea8
😎 Deploy Preview https://deploy-preview-16736--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 11, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit df2b6dd
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6668901bda73620008be2b2b
😎 Deploy Preview https://deploy-preview-16736--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@alisonjoseph
Copy link
Member Author

@tay1orjones I'm not sure how we test for this, this is the issue in the generated code for the two icons above.

the style prop should be an object, not a string like it was being generated.

Seems like it was related to isolation: isolate; and mix-blend-mode: multiply; specifically, since other icons have styles like fill and stroke without any issues.

import React from 'react';
import Icon from './Icon.js';
import { i as iconPropTypes } from './iconPropTypes-4cbeb95d.js';
import '@carbon/icon-helpers';
import 'prop-types';

var _g;
const KubernetesControlPlaneNode = /*#__PURE__*/React.forwardRef(function KubernetesControlPlaneNode(_ref, ref) {
  let {
    children,
    size = 16,
    ...rest
  } = _ref;
  return /*#__PURE__*/React.createElement(Icon, {
    width: size,
    height: size,
    ref: ref,
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 32 32",
    fill: "currentColor",
    ...rest
  }, _g || (_g = /*#__PURE__*/React.createElement("g", {
    style: "isolation:isolate"
  }, /*#__PURE__*/React.createElement("path", {
    strokeWidth: "0",
    d: "M22.951 20h-2.1843c-.4141-1.1611-1.5137-2-2.8157-2s-2.4016.8389-2.8157 2h-6.1843v2h6.1843c.4141 1.1611 1.5137 2 2.8157 2s2.4016-.8389 2.8157-2h2.1843v-2zm-5 2c-.5515 0-1-.4487-1-1s.4485-1 1-1 1 .4487 1 1-.4485 1-1 1zM22.951 12h-6.1843c-.4141-1.1611-1.5137-2-2.8157-2s-2.4016.8389-2.8157 2h-2.1843v2h2.1843c.4141 1.1611 1.5137 2 2.8157 2s2.4016-.8389 2.8157-2h6.1843v-2zm-9 2c-.5515 0-1-.4487-1-1s.4485-1 1-1 1 .4487 1 1-.4485 1-1 1z"
  }), /*#__PURE__*/React.createElement("path", {
    d: "m29.8993,18.9897l-2.593-11.1865c-.1406-.6074-.5564-1.1143-1.124-1.3711l-9.407-4.2544c-.262-.1187-.5432-.1777-.8242-.1777s-.5623.0591-.8242.1777L5.7197,6.4321c-.5676.2568-.9834.7637-1.124,1.3711l-2.593,11.1865c-.1387.5981.0051,1.2271.3899,1.7056l6.886,8.5586c.3796.4717.9526.7461,1.5581.7461h10.2286c.6055,0,1.1785-.2744,1.5581-.7461l6.886-8.5586c.3848-.4785.5286-1.1074.3899-1.7056Zm-8.834,9.0103h-10.2283l-6.886-8.5586,2.593-11.187,9.407-4.2544,9.407,4.2549,2.593,11.1865-6.8858,8.5586Z",
    style: "mix-blend-mode:multiply",
    strokeWidth: "0"
  }))), children);
});
if (process.env.NODE_ENV !== "production") {
  KubernetesControlPlaneNode.propTypes = iconPropTypes;
}

export { KubernetesControlPlaneNode as default };

Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

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

We can track this issue on the next realease for carbon-website to test

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Interesting - yeah I'm not sure how or if we should test for it. Great idea to test it on the website

@tay1orjones tay1orjones added this pull request to the merge queue Jun 13, 2024
Merged via the queue into carbon-design-system:main with commit 8330078 Jun 13, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Icon search goes black when searching specific terms
4 participants