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

Replace settings icon #827

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
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 @@ -21,6 +21,7 @@
height: 1.25rem;
margin-inline-end: 5px;
transform-origin: center center;
justify-content: center;

> svg {
fill: currentColor;
Expand Down
20 changes: 6 additions & 14 deletions src/core/panel/plugin-panel.horizontal.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,16 @@
justify-self: flex-end;
position: relative;
margin: 5px 10px;
top: -2px;
width: 7px;
height: 7px;
width: 15px;
height: 15px;
z-index: 1;
pointer-events: none;

border-left: 2px solid currentColor;
border-top: 2px solid currentColor;

transform: rotate(225deg);
transform-origin: center;
transition:
transform 0.5s ease-in-out,
top 0.5s ease-in-out;
background: currentColor;
clip-path: polygon(50% 80%, 0% 30%, 5% 20%, 50% 65%, 95% 20%, 100% 30%);
animation: rotate 0.5s linear both;
}

&[collapsible][collapsed] .uip-plugin-header::after {
top: 2px;
transform: rotate(45deg);
animation: rotate-back 0.5s linear both;
}
}
2 changes: 1 addition & 1 deletion src/plugins/settings/settings.icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from 'jsx-dom';

export const SettingsIcon = (): SVGElement => (
<svg xmlns="http://www.w3.org/2000/svg" fill="#1f1f1f" stroke="#1f1f1f" stroke-width=".5" viewBox="0 0 24 24">
<svg id={'settings-icon'} xmlns="http://www.w3.org/2000/svg" fill="#1f1f1f" stroke="#1f1f1f" stroke-width=".5" viewBox="0 0 24 24">
Copy link
Contributor

Choose a reason for hiding this comment

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

UIPlayground is not limited to one per page, so we should use a class instead of a unique identifier in case we want to hide the icon.

<path d="m13.302.632.645 2.424.099.358.382.1a9.53 9.53 0 0 1 4.21 2.269l.278.263.382-.102 2.551-.684 1.305 2.115-1.915 1.734-.288.26.105.358c.218.766.326 1.53.326 2.273 0 .743-.108 1.507-.326 2.273l-.105.359.288.26 1.915 1.733-1.305 2.115-2.55-.684-.383-.102-.277.263a9.53 9.53 0 0 1-4.21 2.27l-.383.099-.099.358-.645 2.424h-2.604l-.645-2.424-.099-.358-.382-.1a9.53 9.53 0 0 1-4.21-2.269l-.278-.263-.382.102-2.551.684-1.305-2.115 1.915-1.734.288-.26-.105-.358A8.326 8.326 0 0 1 2.618 12c0-.743.108-1.507.326-2.273l.105-.359-.288-.26L.846 7.376 2.15 5.26l2.55.684.383.102.277-.263a9.53 9.53 0 0 1 4.21-2.27l.383-.099.099-.358.645-2.424h2.604ZM12 17.345c3.144 0 5.702-2.398 5.702-5.345 0-2.947-2.558-5.345-5.702-5.345S6.298 9.053 6.298 12c0 2.947 2.558 5.345 5.702 5.345ZM13.828 0h-3.656l-.776 2.901c-1.73.435-3.28 1.28-4.512 2.435l-3.056-.82L0 7.484l2.295 2.079A8.901 8.901 0 0 0 1.944 12c0 .845.126 1.658.35 2.438L0 16.515l1.828 2.968 3.056-.82c1.232 1.155 2.783 2 4.512 2.435L10.172 24h3.656l.776-2.901a10.23 10.23 0 0 0 4.512-2.434l3.056.819L24 16.516l-2.295-2.078c.221-.78.351-1.593.351-2.438 0-.842-.126-1.658-.35-2.434L24 7.486l-1.828-2.97-3.056.82A10.292 10.292 0 0 0 14.604 2.9L13.828 0ZM12 16.714c-2.775 0-5.028-2.112-5.028-4.714 0-2.602 2.253-4.714 5.028-4.714 2.775 0 5.028 2.112 5.028 4.714 0 2.602-2.253 4.714-5.028 4.714Z"/>
</svg>
) as SVGElement;
21 changes: 19 additions & 2 deletions src/plugins/settings/settings.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../site/src/variables';

uip-settings {
display: none;
}
Expand Down Expand Up @@ -59,12 +61,27 @@ uip-settings {
height: 1.25rem;
}

&.vertical .uip-plugin-header-icon {
&::after {
content: '';
position: relative;
top: 4px;
width: 15px;
height: 15px;
background: currentColor;
clip-path: polygon(20% 50%, 70% 0%, 80% 5%, 35% 50%, 80% 95%, 70% 100%);
}
#settings-icon {
display: none;
}
}

// Rotate on collapsed state change
&[collapsed] .uip-plugin-header-icon {
animation: rotate 0.5s linear both;
animation: rotate-back 0.5s linear both;
}
&:not([collapsed]) .uip-plugin-header-icon {
animation: rotate-back 0.5s linear both;
animation: rotate 0.5s linear both;
}

&[inactive]&[hideable] {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/snippets/snippets.less
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
.uip-snippets-item {
font-weight: 400;
padding: 6px 24px 8px;
text-align: start;
}

.uip-snippets-item-wrapper {
Expand Down
Loading