Skip to content

Commit

Permalink
Add border-gradient mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
sophschneider committed Apr 2, 2024
1 parent 2ff9427 commit ab8a8cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions polaris-react/postcss-mixins/border-gradient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Applies a border-gradient effect to an element.
// @param $backgroundColor - Color of element inside the border. Transparent colors are not supported.
// @param $borderGradientColor - Color gradient to use for the border
// @param $borderRadius - Polaris BorderRadiusScale custom property.
module.exports = (_, backgroundColor, borderGradientColor, borderRadius) => ({
borderRadius: borderRadius,

Check failure on line 6 in polaris-react/postcss-mixins/border-gradient.js

View workflow job for this annotation

GitHub Actions / Lint & type check

Expected property shorthand
border: 'solid var(--p-border-width-025) transparent',
backgroundColor: backgroundColor,

Check failure on line 8 in polaris-react/postcss-mixins/border-gradient.js

View workflow job for this annotation

GitHub Actions / Lint & type check

Expected property shorthand
backgroundImage: `linear-gradient(${backgroundColor}, ${backgroundColor}), ${borderGradientColor}`,
backgroundOrigin: 'border-box',
backgroundClip: 'padding-box, border-box',
});

0 comments on commit ab8a8cc

Please sign in to comment.