Skip to content

Commit

Permalink
feat: border support for image
Browse files Browse the repository at this point in the history
  • Loading branch information
ObjectKaz authored and sunsonliu committed Jul 6, 2022
1 parent 12b1174 commit 6df8fdc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function processExtendAttributesInAlt(alt) {
* @returns
*/
export function processExtendStyleInAlt(alt) {
const styleRegex = /#(center|right|left|float-right|float-left)/i;
const styleRegex = /#(center|right|left|float-right|float-left|border|shadow)/i;
const info = alt.match(styleRegex);
if (!info) {
return '';
Expand All @@ -49,6 +49,12 @@ export function processExtendStyleInAlt(alt) {
case 'float-left':
extendStyles += 'float:left;transform:translateX(0);margin-left:0;display:block;';
break;
case 'border':
extendStyles += 'border:1px solid #dfe6ee;';
break;
case 'shadow':
extendStyles += 'box-shadow:0 2px 15px -5px rgb(0 0 0 / 50%);';
break;
}
return extendStyles;
}

0 comments on commit 6df8fdc

Please sign in to comment.