Skip to content

Commit

Permalink
fix: fix visual accessibility, rework copy button icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Dec 18, 2023
1 parent 792ac98 commit c4eb87d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core/base/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ html {

--uip-plugin-fg: #000;
--uip-plugin-bg: #f5f2f0;
--uip-plugin-hover-fg: #0086cc;
--uip-plugin-divider: #ccc;
--uip-plugin-header-bg: #ccc;
--uip-plugin-header-fg: #000;
Expand Down
17 changes: 17 additions & 0 deletions src/core/button/plugin-button.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.uip-plugin-button {
position: relative;
transition: color 0.25s ease-in-out;

&::before {
content: '';
position: absolute;
inset: -4px;
z-index: -1;
}

.uip-plugin-header-toolbar &:hover {
color: var(--uip-plugin-hover-fg);
}
}


1 change: 1 addition & 0 deletions src/core/panel/plugin-panel.header.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
height: 100%;
z-index: 1;

cursor: pointer;
background: transparent;
border: none;
box-shadow: none;
Expand Down
1 change: 1 addition & 0 deletions src/core/registration.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
@import './base/plugin.less';

@import './panel/plugin-panel.less';
@import './button/plugin-button.less';

@import './preview/preview.less';
5 changes: 2 additions & 3 deletions src/plugins/copy/copy-button.icon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'jsx-dom';

export const CopyIcon = (): SVGElement => (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#5f5f5f" stroke-width="1.25" viewBox="0 0 24 24">
<rect width="12" height="15" x="4" y="3" fill="#fff" rx="2"/>
<rect width="12" height="15" x="8" y="7" fill="#fff" rx="2"/>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M19.5 16.5v-12l-.75-.75H9l-.75.75v3h-3l-.75.75v12l.75.75H15l.75-.75v-3h3l.75-.75Zm-3.75-.75v-7.5L15 7.5H9.75V5.25H18v10.5h-2.25ZM6 9h8.25v10.5H6V9Z"/>
</svg>
) as SVGElement;
1 change: 1 addition & 0 deletions src/plugins/copy/copy-button.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ uip-copy {
cursor: pointer;

> svg {
fill: currentColor;
width: 100%;
height: 100%;
}
Expand Down

0 comments on commit c4eb87d

Please sign in to comment.