Skip to content

Commit

Permalink
refactor(uip-settings): draft attempt to rework settings section styl…
Browse files Browse the repository at this point in the history
…es (layouts, themes, compact mode)
  • Loading branch information
ala-n committed Oct 17, 2023
1 parent a78e4bc commit f89f939
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/plugins/registration.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import './header/header.less';
@import './header/snippets/snippets.less';
@import './header/options/options.less';

@import "./copy/uip-copy.less";
@import './editor/editor.less';
@import './settings/settings.less';
4 changes: 4 additions & 0 deletions src/plugins/settings/settings.horizontal.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
width: 100%;
border-top: 1px solid var(--uip-settings-divider, transparent);
border-bottom: 1px solid var(--uip-settings-divider, transparent);

&-icon {
margin-inline-end: 5px;
}
}

.uip-settings-inner {
Expand Down
17 changes: 14 additions & 3 deletions src/plugins/settings/settings.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@import (reference) '../../common/variables.less';

html {
--uip-settings-fg: #000;
--uip-settings-bg: #f5f2f0;
--uip-settings-divider: #ccc;
--uip-settings-divider-v: @section-border;
--uip-settings-header-bg: #ccc;
Expand All @@ -15,15 +17,17 @@ uip-settings {
grid-area: sidebar;

display: flex;
overflow: auto;
accent-color: @dark-text;
accent-color: var(--uip-settings-fg, #000);

&-inner {
flex: 1 1 auto;
display: flex;
position: relative;
overflow: hidden;
padding: 0;

color: var(--uip-editor-fg);
background: var(--uip-editor-bg);
}

&-container {
Expand Down Expand Up @@ -61,6 +65,7 @@ uip-settings {
&-title:not(:empty) {
flex: 1 1 auto;
padding: 5px;
line-height: 1em;
}

&-trigger {
Expand All @@ -79,13 +84,19 @@ uip-settings {

&-icon {
display: inline-flex;
width: 1.25rem;
width: 1.5rem;
height: 1.25rem;
margin-block: -5px;
transform-origin: center center;

> svg {
fill: currentColor;
stroke: currentColor;
}
}
}
}

@import "./settings.vertical.less";
@import "./settings.horizontal.less";
@import "./settings.themes.less";
7 changes: 7 additions & 0 deletions src/plugins/settings/settings.themes.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[dark-theme] {
--uip-settings-fg: #ccc;
--uip-settings-bg: #2f2f2f;
--uip-settings-divider: #ebebeb;
--uip-settings-header-bg: #2f2f2f;
--uip-settings-header-fg: #ccc;
}
7 changes: 5 additions & 2 deletions src/plugins/settings/settings.vertical.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
}

.uip-settings-header {
border-left: 1px solid var(--uip-settings-divider-v, transparent);
border-right: 1px solid var(--uip-settings-divider-v, transparent);
border-inline-end: 1px solid var(--uip-settings-divider-v, transparent);
}

.uip-editor-compact & .uip-settings-header {
margin-bottom: -30px;
}

.uip-settings-header-title {
Expand Down
30 changes: 29 additions & 1 deletion src/plugins/settings/slider-setting/slider-setting.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,36 @@
width: 100%;
}

input[type="range"] {
-webkit-appearance: none;
margin: 10px 0 5px;
height: 10px;
background: var(--uip-settings-bg, #000);
border: 1px solid var(--uip-settings-fg, #ccc);
border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
height: 15px;
width: 15px;
border-radius: 50%;
background:var(--uip-settings-fg, #000);
cursor: ew-resize;
transition: background .1s linear;
}

input[type=range]::-webkit-slider-runnable-track {
-webkit-appearance: none;
box-shadow: none;
border: none;
background: transparent;
}


.slider-value {
color: gray;
opacity: 0.8;
color: var(--uip-settings-fg, #000);

&.disabled {
font-size: 14px;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/settings/text-setting/text-setting.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
width: 100%;
padding: 3px 1px 1px;
font-size: 16px;
color: @dark-text;
color: var(--uip-settings-fg, #000);
background: transparent;
border: 1px solid var(--uip-settings-fg, #000);
box-shadow: none;
}

0 comments on commit f89f939

Please sign in to comment.