mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Update UI colors and alignment for consistency with the design mockup (#157)
Closes #111
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
<template>
|
||||
<div class="item-spacer" :class="{ horizontal: horizontal }">
|
||||
<div></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.item-spacer {
|
||||
margin-left: 0;
|
||||
|
||||
& + * {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
&:not(.horizontal) {
|
||||
height: 100%;
|
||||
padding: 0 8px;
|
||||
|
||||
div {
|
||||
height: calc(100% - 8px);
|
||||
width: 1px;
|
||||
margin: 4px 0;
|
||||
background: #888;
|
||||
}
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
width: 100%;
|
||||
padding: 8px 0;
|
||||
|
||||
div {
|
||||
height: 1px;
|
||||
width: calc(100% - 8px);
|
||||
margin: 0 4px;
|
||||
background: #888;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
props: {
|
||||
horizontal: { type: Boolean, default: false },
|
||||
},
|
||||
});
|
||||
</script>
|
||||
82
client/web/src/components/widgets/Separator.vue
Normal file
82
client/web/src/components/widgets/Separator.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="separator" :class="[direction.toLowerCase(), type.toLowerCase()]">
|
||||
<div v-if="type === SeparatorType.Section"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.separator {
|
||||
&.vertical {
|
||||
&.related {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
&.unrelated {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
&.section {
|
||||
width: 100%;
|
||||
margin: 8px 0;
|
||||
|
||||
div {
|
||||
height: 1px;
|
||||
width: calc(100% - 8px);
|
||||
margin: 0 4px;
|
||||
background: var(--color-7-middlegray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
&.related {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
&.unrelated {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
&.section {
|
||||
height: 100%;
|
||||
margin: 0 8px;
|
||||
|
||||
div {
|
||||
height: calc(100% - 8px);
|
||||
width: 1px;
|
||||
margin: 4px 0;
|
||||
background: var(--color-7-middlegray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
|
||||
export enum SeparatorDirection {
|
||||
"Horizontal" = "Horizontal",
|
||||
"Vertical" = "Vertical",
|
||||
}
|
||||
|
||||
export enum SeparatorType {
|
||||
"Related" = "Related",
|
||||
"Unrelated" = "Unrelated",
|
||||
"Section" = "Section",
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
props: {
|
||||
direction: { type: String, default: SeparatorDirection.Horizontal },
|
||||
type: { type: String, default: SeparatorType.Unrelated },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
SeparatorDirection,
|
||||
SeparatorType,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -10,11 +10,11 @@
|
||||
border-radius: 2px;
|
||||
|
||||
&:hover {
|
||||
background: #666;
|
||||
background: var(--color-6-lowergray);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #3194d6;
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
svg {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<button class="icon-button" :class="[`size-${String(size)}`, gapAfter && 'gap-after']">
|
||||
<button class="icon-button" :class="`size-${String(size)}`">
|
||||
<slot></slot>
|
||||
</button>
|
||||
</template>
|
||||
@@ -14,7 +14,7 @@
|
||||
border-radius: 2px;
|
||||
background: none;
|
||||
vertical-align: top;
|
||||
fill: #ddd;
|
||||
fill: var(--color-e-nearwhite);
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
||||
@@ -23,14 +23,10 @@
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
&.gap-after + .icon-button {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #666;
|
||||
color: white;
|
||||
fill: white;
|
||||
background: var(--color-6-lowergray);
|
||||
color: var(--color-f-white);
|
||||
fill: var(--color-f-white);
|
||||
}
|
||||
|
||||
&.size-10 {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
position: relative;
|
||||
width: 16px;
|
||||
height: 24px;
|
||||
margin: 2px 4px;
|
||||
flex: 0 0 auto;
|
||||
|
||||
.popover {
|
||||
left: 50%;
|
||||
@@ -29,12 +29,12 @@
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
vertical-align: top;
|
||||
background: #111;
|
||||
fill: #ddd;
|
||||
background: var(--color-1-nearblack);
|
||||
fill: var(--color-e-nearwhite);
|
||||
|
||||
&:hover {
|
||||
background: #666;
|
||||
fill: #fff;
|
||||
background: var(--color-6-lowergray);
|
||||
fill: var(--color-f-white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
padding: 0 8px;
|
||||
|
||||
svg {
|
||||
fill: #ddd;
|
||||
fill: var(--color-e-nearwhite);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #666;
|
||||
background: var(--color-6-lowergray);
|
||||
|
||||
svg {
|
||||
fill: #fff;
|
||||
fill: var(--color-f-white);
|
||||
}
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
color: var(--color-f-white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="number-input">
|
||||
<button class="arrow left"></button>
|
||||
<button class="arrow right"></button>
|
||||
<input type="text" spellcheck="false" value="25%" />
|
||||
<input type="text" spellcheck="false" :value="`${value}${unit}`" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
height: 24px;
|
||||
position: relative;
|
||||
border-radius: 2px;
|
||||
background: #111;
|
||||
background: var(--color-1-nearblack);
|
||||
overflow: hidden;
|
||||
|
||||
input {
|
||||
@@ -23,13 +23,13 @@
|
||||
background: none;
|
||||
padding: 0;
|
||||
line-height: 24px;
|
||||
color: #ddd;
|
||||
color: var(--color-e-nearwhite);
|
||||
font-size: inherit;
|
||||
text-align: center;
|
||||
font-family: inherit;
|
||||
|
||||
&::selection {
|
||||
background: #3194d6;
|
||||
background: var(--color-accent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@
|
||||
padding: 9px 0;
|
||||
|
||||
&:hover {
|
||||
background: #666;
|
||||
background: var(--color-6-lowergray);
|
||||
|
||||
&.right::before {
|
||||
border-color: transparent transparent transparent #fff;
|
||||
border-color: transparent transparent transparent var(--color-f-white);
|
||||
}
|
||||
|
||||
&.left::after {
|
||||
border-color: transparent #fff transparent transparent;
|
||||
border-color: transparent var(--color-f-white) transparent transparent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 3px 0 3px 3px;
|
||||
border-color: transparent transparent transparent #ddd;
|
||||
border-color: transparent transparent transparent var(--color-e-nearwhite);
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 3px 3px 3px 0;
|
||||
border-color: transparent #ddd transparent transparent;
|
||||
border-color: transparent var(--color-e-nearwhite) transparent transparent;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -97,6 +97,9 @@ import { defineComponent } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
props: {},
|
||||
props: {
|
||||
value: { type: Number, required: true },
|
||||
unit: { type: String, default: "" },
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -29,17 +29,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
background: #555;
|
||||
fill: #ddd;
|
||||
& > button {
|
||||
background: var(--color-5-dullgray);
|
||||
fill: var(--color-e-nearwhite);
|
||||
|
||||
&:hover {
|
||||
background: #666;
|
||||
background: var(--color-6-lowergray);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #3194d6;
|
||||
fill: #fff;
|
||||
background: var(--color-accent);
|
||||
fill: var(--color-f-white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<div class="swatch-pair">
|
||||
<div class="secondary swatch">
|
||||
<button @click="clickSecondarySwatch" style="background: white"></button>
|
||||
<button @click="clickSecondarySwatch" style="background: #ffffff"></button>
|
||||
<Popover :direction="PopoverDirection.Right" horizontal ref="secondarySwatchPopover">
|
||||
<ColorPicker />
|
||||
</Popover>
|
||||
</div>
|
||||
<div class="primary swatch">
|
||||
<button @click="clickPrimarySwatch" style="background: black"></button>
|
||||
<button @click="clickPrimarySwatch" style="background: #000000"></button>
|
||||
<Popover :direction="PopoverDirection.Right" horizontal ref="primarySwatchPopover">
|
||||
<ColorPicker />
|
||||
</Popover>
|
||||
@@ -24,15 +24,15 @@
|
||||
.swatch {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin: 2px;
|
||||
margin: 0 2px;
|
||||
position: relative;
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
border: 2px #888 solid;
|
||||
box-shadow: 0 0 0 2px #333;
|
||||
border: 2px var(--color-7-middlegray) solid;
|
||||
box-shadow: 0 0 0 2px var(--color-3-darkgray);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="icon" :class="[`size-${String(size)}`, gapAfter && 'gap-after']">
|
||||
<div class="icon" :class="`size-${String(size)}`">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
@@ -8,14 +8,11 @@
|
||||
.icon {
|
||||
display: inline-block;
|
||||
flex: 0 0 auto;
|
||||
fill: #ddd;
|
||||
fill: var(--color-e-nearwhite);
|
||||
vertical-align: top;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
||||
&:not(.gap-after) + .icon {
|
||||
margin-left: 0;
|
||||
}
|
||||
margin-left: 0;
|
||||
|
||||
&.size-10 {
|
||||
width: 10px;
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
font-family: "Inconsolata", monospace;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
color: #111;
|
||||
background: #ddd;
|
||||
color: var(--color-2-mildblack);
|
||||
background: var(--color-e-nearwhite);
|
||||
border: 1px;
|
||||
box-sizing: border-box;
|
||||
border-style: solid;
|
||||
border-color: #888;
|
||||
border-color: var(--color-7-middlegray);
|
||||
border-radius: 4px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
@@ -71,11 +71,11 @@
|
||||
|
||||
.input-mouse {
|
||||
.bright {
|
||||
fill: #ddd;
|
||||
fill: var(--color-e-nearwhite);
|
||||
}
|
||||
|
||||
.dim {
|
||||
fill: #888;
|
||||
fill: var(--color-7-middlegray);
|
||||
}
|
||||
|
||||
svg {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
@use "sass:color";
|
||||
|
||||
.popover {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
@@ -35,28 +37,28 @@
|
||||
|
||||
.top > & {
|
||||
border-width: 8px 6px 0 6px;
|
||||
border-color: #222222e6 transparent transparent transparent;
|
||||
border-color: var(--popover-opacity-color-2-mildblack) transparent transparent transparent;
|
||||
margin-left: -6px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.bottom > & {
|
||||
border-width: 0 6px 8px 6px;
|
||||
border-color: transparent transparent #222222e6 transparent;
|
||||
border-color: transparent transparent var(--popover-opacity-color-2-mildblack) transparent;
|
||||
margin-left: -6px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.left > & {
|
||||
border-width: 6px 0 6px 8px;
|
||||
border-color: transparent transparent transparent #222222e6;
|
||||
border-color: transparent transparent transparent var(--popover-opacity-color-2-mildblack);
|
||||
margin-top: -6px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.right > & {
|
||||
border-width: 6px 8px 6px 0;
|
||||
border-color: transparent #222222e6 transparent transparent;
|
||||
border-color: transparent var(--popover-opacity-color-2-mildblack) transparent transparent;
|
||||
margin-top: -6px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
@@ -86,10 +88,10 @@
|
||||
}
|
||||
|
||||
.popover-content {
|
||||
background: #222222e6;
|
||||
box-shadow: #000 0 0 4px;
|
||||
background: var(--popover-opacity-color-2-mildblack);
|
||||
box-shadow: var(--color-0-black) 0 0 4px;
|
||||
border-radius: 4px;
|
||||
color: #eee;
|
||||
color: var(--color-e-nearwhite);
|
||||
font-size: inherit;
|
||||
padding: 8px;
|
||||
z-index: 0;
|
||||
|
||||
Reference in New Issue
Block a user