0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-31 19:39:07 -05:00

Merge pull request #3805 from penpot/alotor-ui-polish-2

💄 New UI polishing
This commit is contained in:
Eva Marco 2023-11-15 17:38:35 +01:00 committed by GitHub
commit 59162e4f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 84 additions and 47 deletions

View file

@ -65,7 +65,8 @@
stroke: var(--button-primary-foreground-color-active); stroke: var(--button-primary-foreground-color-active);
} }
} }
&:global(.disabled) { &:global(.disabled),
&[disabled] {
background-color: var(--button-background-color-disabled); background-color: var(--button-background-color-disabled);
border: $s-1 solid var(--button-border-color-disabled); border: $s-1 solid var(--button-border-color-disabled);
color: var(--button-foreground-color-disabled); color: var(--button-foreground-color-disabled);
@ -105,7 +106,8 @@
stroke: var(--button-secondary-foreground-color-active); stroke: var(--button-secondary-foreground-color-active);
} }
} }
&:global(.disabled) { &:global(.disabled),
&[disabled] {
background-color: var(--button-background-color-disabled); background-color: var(--button-background-color-disabled);
border: $s-1 solid var(--button-border-color-disabled); border: $s-1 solid var(--button-border-color-disabled);
color: var(--button-foreground-color-disabled); color: var(--button-foreground-color-disabled);
@ -144,11 +146,16 @@
stroke: var(--button-tertiary-foreground-color-active); stroke: var(--button-tertiary-foreground-color-active);
} }
} }
&:global(.disabled) { &:global(.disabled),
background-color: var(--button-background-color-disabled); &[disabled] {
border: $s-1 solid var(--button-border-color-disabled);
color: var(--button-foreground-color-disabled); color: var(--button-foreground-color-disabled);
cursor: unset; cursor: unset;
pointer-events: none;
svg,
span svg {
stroke: var(--button-background-color-disabled);
}
} }
} }

View file

@ -14,10 +14,13 @@
.tab-container-content { .tab-container-content {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
display: flex;
flex-direction: column;
} }
.tab-element { .tab-element {
height: fit-content; flex: 1;
height: 100%;
} }
} }
.tab-container-tabs { .tab-container-tabs {

View file

@ -17,6 +17,7 @@
} }
} }
.code-block { .code-block {
padding: 0 $s-4 $s-8 0;
.code-row-lang { .code-row-lang {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View file

@ -7,6 +7,8 @@
@import "refactor/common-refactor.scss"; @import "refactor/common-refactor.scss";
.element-set { .element-set {
padding-bottom: $s-16;
.element-title { .element-title {
.title-spacing-export-viewer { .title-spacing-export-viewer {
@extend .attr-title; @extend .attr-title;

View file

@ -15,6 +15,9 @@
right: unset; right: unset;
grid-area: right-sidebar; grid-area: right-sidebar;
.tool-windows { .tool-windows {
height: 100%;
display: flex;
flex-direction: column;
.shape-row { .shape-row {
display: flex; display: flex;
gap: $s-8; gap: $s-8;
@ -61,4 +64,9 @@
padding: $s-8 $s-24; padding: $s-8 $s-24;
} }
} }
.inspect-content {
flex: 1;
overflow: hidden;
}
} }

View file

@ -8,6 +8,8 @@
.color-values { .color-values {
@include flexColumn; @include flexColumn;
margin-top: $s-8;
&.disable-opacity { &.disable-opacity {
grid-template-columns: 3.5rem repeat(3, 1fr); grid-template-columns: 3.5rem repeat(3, 1fr);
} }
@ -16,6 +18,8 @@
.input-wrapper { .input-wrapper {
@extend .input-element; @extend .input-element;
width: $s-84; width: $s-84;
display: flex;
align-items: baseline;
} }
} }
.hex-alpha-wrapper { .hex-alpha-wrapper {
@ -25,6 +29,9 @@
width: $s-84; width: $s-84;
&.hex { &.hex {
width: $s-172; width: $s-172;
display: flex;
align-items: baseline;
gap: $s-8;
} }
} }
} }

View file

@ -12,7 +12,7 @@
height: $s-140; height: $s-140;
width: $s-256; width: $s-256;
margin-top: $s-12; margin-top: $s-12;
margin-bottom: $s-6; margin-bottom: $s-12;
cursor: pointer; cursor: pointer;
.handler { .handler {
@ -44,3 +44,6 @@
height: $s-52; height: $s-52;
cursor: pointer; cursor: pointer;
} }
.sliders-wrapper {
@include flexColumn;
}

View file

@ -62,7 +62,7 @@
flex-direction: column; flex-direction: column;
height: calc(100% - $s-12); height: calc(100% - $s-12);
.title-spacing-lib { .title-spacing-lib {
margin: 0 0 $s-24 calc(-1 * $s-8); margin: 0 0 0 calc(-1 * $s-8);
} }
.section-list, .section-list,
.section-list-shared { .section-list-shared {
@ -70,6 +70,7 @@
max-height: $s-320; max-height: $s-320;
margin-top: $s-12; margin-top: $s-12;
overflow: auto; overflow: auto;
padding-right: $s-8;
.section-list-item { .section-list-item {
display: grid; display: grid;
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;

View file

@ -112,6 +112,7 @@
.palette { .palette {
grid-area: palette; grid-area: palette;
width: 100%; width: 100%;
min-width: 0;
} }
.handler { .handler {
@include buttonStyle; @include buttonStyle;

View file

@ -32,18 +32,16 @@ $width-settings-bar-max: $s-500;
left: 0; left: 0;
width: 100%; width: 100%;
height: $s-12; height: $s-12;
border-top: 2px solid var(--color-background-secondary); border-top: 2px solid var(--color-background-quaternary);
background-color: var(--color-background-primary); background-color: var(--color-background-primary);
cursor: ns-resize; cursor: ns-resize;
&:hover {
border-color: var(--color-background-quaternary);
}
} }
.settings-bar-inside { .settings-bar-inside {
display: grid; display: grid;
grid-template-columns: 100%; grid-template-columns: 100%;
grid-template-rows: 100%; grid-template-rows: 100%;
height: calc(100vh - $s-52); height: calc(100vh - $s-52);
overflow: hidden;
.tabs-wrapper { .tabs-wrapper {
.layers-tab { .layers-tab {
display: grid; display: grid;
@ -63,6 +61,8 @@ $width-settings-bar-max: $s-500;
width: $width-settings-bar; width: $width-settings-bar;
background-color: var(--panel-background-color); background-color: var(--panel-background-color);
height: 100%; height: 100%;
display: flex;
flex-direction: column;
&.not-expand { &.not-expand {
max-width: $width-settings-bar; max-width: $width-settings-bar;
} }

View file

@ -11,6 +11,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%;
padding-left: $s-12; padding-left: $s-12;
.tab-spacing { .tab-spacing {
@ -27,6 +28,7 @@
.element-options { .element-options {
width: 100%; width: 100%;
height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: $s-16; gap: $s-16;

View file

@ -98,6 +98,7 @@
@extend .input-element; @extend .input-element;
width: $s-60; width: $s-60;
min-width: $s-60; min-width: $s-60;
align-items: baseline;
input { input {
width: $s-32; width: $s-32;
} }
@ -109,6 +110,9 @@
width: $s-44; width: $s-44;
} }
} }
.spread-input {
gap: $s-8;
}
} }
} }
} }

View file

@ -24,6 +24,10 @@
border-radius: $br-8 0 0 $br-8; border-radius: $br-8 0 0 $br-8;
padding: 0; padding: 0;
margin-right: 0; margin-right: 0;
gap: $s-4;
input {
padding: 0;
}
&.no-opacity { &.no-opacity {
border-radius: $br-8; border-radius: $br-8;
} }

View file

@ -12,13 +12,12 @@
@include flexRow; @include flexRow;
.stroke-width-input-element { .stroke-width-input-element {
@extend .input-element; @extend .input-element;
width: $s-60; width: $s-96;
border-radius: $br-8; border-radius: $br-8;
.icon { .icon {
@include flexCenter; @include flexCenter;
height: $s-32; height: $s-32;
width: $s-12; width: $s-20;
margin-right: $s-4;
} }
} }
.select-wrapper { .select-wrapper {

View file

@ -115,14 +115,14 @@
[:div {:class (stl/css :sub-actions)} [:div {:class (stl/css :sub-actions)}
[:div {:class (stl/css :sub-actions-group)} [:div {:class (stl/css :sub-actions-group)}
;; Draw Mode ;; Draw Mode
[:button [:button
{:class (stl/css-case :is-toggled (= edit-mode :draw)) {:class (stl/css-case :is-toggled (= edit-mode :draw))
:title (tr "workspace.path.actions.draw-nodes" (sc/get-tooltip :draw-nodes)) :title (tr "workspace.path.actions.draw-nodes" (sc/get-tooltip :draw-nodes))
:on-click on-select-draw-mode} :on-click on-select-draw-mode}
i/pentool-refactor] i/pentool-refactor]
;; Edit mode ;; Edit mode
[:button [:button
{:class (stl/css-case :is-toggled (= edit-mode :move)) {:class (stl/css-case :is-toggled (= edit-mode :move))
:title (tr "workspace.path.actions.move-nodes" (sc/get-tooltip :move-nodes)) :title (tr "workspace.path.actions.move-nodes" (sc/get-tooltip :move-nodes))
@ -130,59 +130,58 @@
i/move-refactor]] i/move-refactor]]
[:div {:class (stl/css :sub-actions-group)} [:div {:class (stl/css :sub-actions-group)}
;; Add Node
;; Add Node
[:button [:button
{:class (stl/css-case :is-disabled (not (:add-node enabled-buttons))) {:disabled (not (:add-node enabled-buttons))
:title (tr "workspace.path.actions.add-node" (sc/get-tooltip :add-node)) :title (tr "workspace.path.actions.add-node" (sc/get-tooltip :add-node))
:on-click on-add-node} :on-click on-add-node}
i/add-refactor] i/add-refactor]
;; Remove node ;; Remove node
[:button [:button
{:class (stl/css-case :is-disabled (not (:remove-node enabled-buttons))) {:disabled (not (:remove-node enabled-buttons))
:title (tr "workspace.path.actions.delete-node" (sc/get-tooltip :delete-node)) :title (tr "workspace.path.actions.delete-node" (sc/get-tooltip :delete-node))
:on-click on-remove-node} :on-click on-remove-node}
i/remove-refactor]] i/remove-refactor]]
[:div {:class (stl/css :sub-actions-group)} [:div {:class (stl/css :sub-actions-group)}
;; Merge Nodes ;; Merge Nodes
[:button [:button
{:class (stl/css-case :is-disabled (not (:merge-nodes enabled-buttons))) {:disabled (not (:merge-nodes enabled-buttons))
:title (tr "workspace.path.actions.merge-nodes" (sc/get-tooltip :merge-nodes)) :title (tr "workspace.path.actions.merge-nodes" (sc/get-tooltip :merge-nodes))
:on-click on-merge-nodes} :on-click on-merge-nodes}
i/merge-nodes-refactor] i/merge-nodes-refactor]
;; Join Nodes ;; Join Nodes
[:button [:button
{:class (stl/css-case :is-disabled (not (:join-nodes enabled-buttons))) {:disabled (not (:join-nodes enabled-buttons))
:title (tr "workspace.path.actions.join-nodes" (sc/get-tooltip :join-nodes)) :title (tr "workspace.path.actions.join-nodes" (sc/get-tooltip :join-nodes))
:on-click on-join-nodes} :on-click on-join-nodes}
i/join-nodes-refactor] i/join-nodes-refactor]
;; Separate Nodes ;; Separate Nodes
[:button [:button
{:class (stl/css-case :is-disabled (not (:separate-nodes enabled-buttons))) {:disabled (not (:separate-nodes enabled-buttons))
:title (tr "workspace.path.actions.separate-nodes" (sc/get-tooltip :separate-nodes)) :title (tr "workspace.path.actions.separate-nodes" (sc/get-tooltip :separate-nodes))
:on-click on-separate-nodes} :on-click on-separate-nodes}
i/separate-nodes-refactor]] i/separate-nodes-refactor]]
;; Make Corner ;; Make Corner
[:div {:class (stl/css :sub-actions-group)} [:div {:class (stl/css :sub-actions-group)}
[:button [:button
{:class (stl/css-case :is-disabled (not (:make-corner enabled-buttons))) {:disabled (not (:make-corner enabled-buttons))
:title (tr "workspace.path.actions.make-corner" (sc/get-tooltip :make-corner)) :title (tr "workspace.path.actions.make-corner" (sc/get-tooltip :make-corner))
:on-click on-make-corner} :on-click on-make-corner}
i/to-corner-refactor] i/to-corner-refactor]
;; Make Curve ;; Make Curve
[:button [:button
{:class (stl/css-case :is-disabled (not (:make-curve enabled-buttons))) {:disabled (not (:make-curve enabled-buttons))
:title (tr "workspace.path.actions.make-curve" (sc/get-tooltip :make-curve)) :title (tr "workspace.path.actions.make-curve" (sc/get-tooltip :make-curve))
:on-click on-make-curve} :on-click on-make-curve}
i/to-curve-refactor]] i/to-curve-refactor]]
;; Toggle snap ;; Toggle snap
[:div {:class (stl/css :sub-actions-group)} [:div {:class (stl/css :sub-actions-group)}
[:button [:button
{:class (stl/css-case :is-toggled snap-toggled) {:class (stl/css-case :is-toggled snap-toggled)
@ -195,14 +194,14 @@
[:div.path-actions [:div.path-actions
[:div.viewport-actions-group [:div.viewport-actions-group
;; Draw Mode ;; Draw Mode
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when (= edit-mode :draw) "is-toggled") {:class (when (= edit-mode :draw) "is-toggled")
:alt (tr "workspace.path.actions.draw-nodes" (sc/get-tooltip :draw-nodes)) :alt (tr "workspace.path.actions.draw-nodes" (sc/get-tooltip :draw-nodes))
:on-click on-select-draw-mode} :on-click on-select-draw-mode}
i/pen] i/pen]
;; Edit mode ;; Edit mode
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when (= edit-mode :move) "is-toggled") {:class (when (= edit-mode :move) "is-toggled")
:alt (tr "workspace.path.actions.move-nodes" (sc/get-tooltip :move-nodes)) :alt (tr "workspace.path.actions.move-nodes" (sc/get-tooltip :move-nodes))
@ -210,14 +209,14 @@
i/pointer-inner]] i/pointer-inner]]
[:div.viewport-actions-group [:div.viewport-actions-group
;; Add Node ;; Add Node
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:add-node enabled-buttons) "is-disabled") {:class (when-not (:add-node enabled-buttons) "is-disabled")
:alt (tr "workspace.path.actions.add-node" (sc/get-tooltip :add-node)) :alt (tr "workspace.path.actions.add-node" (sc/get-tooltip :add-node))
:on-click on-add-node} :on-click on-add-node}
i/nodes-add] i/nodes-add]
;; Remove node ;; Remove node
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:remove-node enabled-buttons) "is-disabled") {:class (when-not (:remove-node enabled-buttons) "is-disabled")
:alt (tr "workspace.path.actions.delete-node" (sc/get-tooltip :delete-node)) :alt (tr "workspace.path.actions.delete-node" (sc/get-tooltip :delete-node))
@ -225,28 +224,28 @@
i/nodes-remove]] i/nodes-remove]]
[:div.viewport-actions-group [:div.viewport-actions-group
;; Merge Nodes ;; Merge Nodes
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:merge-nodes enabled-buttons) "is-disabled") {:class (when-not (:merge-nodes enabled-buttons) "is-disabled")
:alt (tr "workspace.path.actions.merge-nodes" (sc/get-tooltip :merge-nodes)) :alt (tr "workspace.path.actions.merge-nodes" (sc/get-tooltip :merge-nodes))
:on-click on-merge-nodes} :on-click on-merge-nodes}
i/nodes-merge] i/nodes-merge]
;; Join Nodes ;; Join Nodes
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:join-nodes enabled-buttons) "is-disabled") {:class (when-not (:join-nodes enabled-buttons) "is-disabled")
:alt (tr "workspace.path.actions.join-nodes" (sc/get-tooltip :join-nodes)) :alt (tr "workspace.path.actions.join-nodes" (sc/get-tooltip :join-nodes))
:on-click on-join-nodes} :on-click on-join-nodes}
i/nodes-join] i/nodes-join]
;; Separate Nodes ;; Separate Nodes
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:separate-nodes enabled-buttons) "is-disabled") {:class (when-not (:separate-nodes enabled-buttons) "is-disabled")
:alt (tr "workspace.path.actions.separate-nodes" (sc/get-tooltip :separate-nodes)) :alt (tr "workspace.path.actions.separate-nodes" (sc/get-tooltip :separate-nodes))
:on-click on-separate-nodes} :on-click on-separate-nodes}
i/nodes-separate]] i/nodes-separate]]
;; Make Corner ;; Make Corner
[:div.viewport-actions-group [:div.viewport-actions-group
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:make-corner enabled-buttons) "is-disabled") {:class (when-not (:make-corner enabled-buttons) "is-disabled")
@ -254,14 +253,14 @@
:on-click on-make-corner} :on-click on-make-corner}
i/nodes-corner] i/nodes-corner]
;; Make Curve ;; Make Curve
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when-not (:make-curve enabled-buttons) "is-disabled") {:class (when-not (:make-curve enabled-buttons) "is-disabled")
:alt (tr "workspace.path.actions.make-curve" (sc/get-tooltip :make-curve)) :alt (tr "workspace.path.actions.make-curve" (sc/get-tooltip :make-curve))
:on-click on-make-curve} :on-click on-make-curve}
i/nodes-curve]] i/nodes-curve]]
;; Toggle snap ;; Toggle snap
[:div.viewport-actions-group [:div.viewport-actions-group
[:div.viewport-actions-entry.tooltip.tooltip-bottom [:div.viewport-actions-entry.tooltip.tooltip-bottom
{:class (when snap-toggled "is-toggled") {:class (when snap-toggled "is-toggled")

View file

@ -41,10 +41,6 @@
border-radius: $s-8; border-radius: $s-8;
border: none; border: none;
margin: 0 $s-2; margin: 0 $s-2;
&.is-disabled {
pointer-events: none;
opacity: 40%;
}
&.is-toggled { &.is-toggled {
background-color: var(--button-radio-background-color-active); background-color: var(--button-radio-background-color-active);
svg { svg {