Skip to content

Commit 60e7e3f

Browse files
authored
Styling Bugfixes (#1160)
* fix: dropdown styling * fix: remove remaining carats * fix: json editor styling issues * fix: sections could leak background * fix: default section styles * fix: dropdowns * fix: dropzone should display border color on drag fix: section icon misalignment * fix: dropdown issues * fix: navigation search * fix: json editor example input alignment * fix: conform search filters * fix: search input font size * feat: make input hints optional feat: set no margin on select * fix: pages and changelog * fix: filter multiselect should have margin similar to other menus
1 parent 6af1c46 commit 60e7e3f

File tree

27 files changed

+141
-61
lines changed

27 files changed

+141
-61
lines changed

projects/swimlane/ngx-ui/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## HEAD (unreleased)
44

5+
- Feat (`ngx-select`): `withMargin` input when set to false will display ngx-select marginless.
6+
- Feat (`ngx-select`, `ngx-input`): `withHint` input when set to false will not display a block element for the hint.
7+
58
## 51.0.0-alpha.1 (2025-10-21)
69

710
- Fix (`ngx-checkbox`): Removed duplicate output emission

projects/swimlane/ngx-ui/src/lib/components/date-range-calendar/date-range-picker.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ngx-dropdown [closeOnClick]="false" [closeOnOutsideClick]="true" #wrapperRef>
2-
<ngx-dropdown-menu class="ngx-dropdown-menu ngx-dropdown-dark-outline" (click)="$event.stopPropagation()">
2+
<ngx-dropdown-menu class="ngx-dropdown-menu" (click)="$event.stopPropagation()">
33
<div class="date-range-selection"><span>Date range selection </span></div>
44
<div class="date-range-picker">
55
<!-- Sidebar Presets -->

projects/swimlane/ngx-ui/src/lib/components/dropdown/dropdown.component.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ $dropdown-color: var(--grey-100);
8181
content: ' ';
8282
display: none;
8383
position: absolute;
84-
left: 10px;
85-
top: -6px;
84+
left: 12px;
85+
top: -5px;
8686
width: 12px;
8787
height: 12px;
8888
background: $dropdown-bg;
@@ -153,7 +153,7 @@ $dropdown-color: var(--grey-100);
153153
&.divider,
154154
&.divider-label {
155155
height: initial;
156-
margin: var(--spacing-8) var(--spacing-0);
156+
margin: var(--spacing-0);
157157
padding: var(--spacing-0) var(--spacing-20);
158158
overflow: hidden;
159159
background-color: initial !important;
@@ -251,6 +251,7 @@ $dropdown-color: var(--grey-100);
251251

252252
// Styles
253253
.ngx-dropdown-menu {
254+
/* @deprecated Dark outline style is marked for deprecation and will be removed at a later date. */
254255
&.ngx-dropdown-light-outline {
255256
$menu-color: var(--grey-750);
256257
$menu-border: var(--grey-550);
@@ -261,9 +262,10 @@ $dropdown-color: var(--grey-100);
261262
@include ngx-dropdown-outline($menu-color, $menu-border, $item-active, $item-hover, $item-color);
262263
}
263264

265+
/* @deprecated This style is marked for deprecation and will be removed at a later date. */
264266
&.ngx-dropdown-dark-outline {
265-
$menu-color: var(--color-grey-750);
266-
$menu-border: var(--color-grey-550);
267+
$menu-color: var(--grey-750);
268+
$menu-border: var(--grey-550);
267269
$item-active: #479eff;
268270
$item-hover: var(--grey-750);
269271
$item-color: #afb7c8;

projects/swimlane/ngx-ui/src/lib/components/dropzone/dropzone.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,9 @@
164164
}
165165
}
166166
}
167+
168+
&:has(.file-over) {
169+
border: 1px dashed #04a6e6;
170+
}
167171
}
168172
}

projects/swimlane/ngx-ui/src/lib/components/filter/filter.component.scss

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,22 @@ $max-width: 300px;
184184

185185
// dropdown active
186186
&.active {
187-
.ngx-select-dropdown--upwards {
188-
opacity: 1;
189-
bottom: 100%;
190-
top: auto;
191-
margin-bottom: var(--spacing-10);
192-
animation: openUpwardsAnimation 0.25s;
193-
}
194-
195-
.ngx-select-dropdown--downwards {
196-
opacity: 1;
197-
animation: openAnimation 0.25s;
198-
}
199-
200187
.ngx-select-dropdown {
201188
display: block;
189+
190+
&--upwards {
191+
animation: openUpwardsAnimation 0.25s;
192+
opacity: 1;
193+
margin-bottom: var(--spacing-10);
194+
top: auto;
195+
bottom: 100%;
196+
}
197+
198+
&--downwards {
199+
animation: openAnimation 0.25s;
200+
opacity: 1;
201+
margin-top: var(--spacing-10);
202+
}
202203
}
203204

204205
.ngx-multi-dimension-selection {
@@ -395,7 +396,7 @@ $max-width: 300px;
395396

396397
.ngx-search {
397398
font-size: var(--font-size-m);
398-
margin-top: -9px;
399+
margin-top: -8px;
399400
}
400401

401402
.ngx-x {
@@ -415,9 +416,9 @@ $max-width: 300px;
415416
border: none;
416417
outline: none;
417418
display: block;
418-
font-size: var(--font-size-xs);
419419
width: 100%;
420420
padding-left: var(--spacing-24);
421+
font-size: var(--font-size-m);
421422

422423
&::-webkit-search-decoration,
423424
&::-webkit-search-cancel-button,

projects/swimlane/ngx-ui/src/lib/components/input/input.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<div class="ngx-input-underline" [ngClass]="{ 'ngx-input-underline__visibility-hidden': readonly }">
109109
<div class="underline-fill" [@underlineState]="underlineState"></div>
110110
</div>
111-
<div class="ngx-input-hint">
111+
<div class="ngx-input-hint" [ngClass]="{ hidden: !withHint }">
112112
<ng-content select="ngx-input-hint"></ng-content>
113113
<span *ngIf="hint" [innerHTML]="hint"></span>
114114
</div>

projects/swimlane/ngx-ui/src/lib/components/input/input.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class InputComponent implements AfterViewInit, OnDestroy, ControlValueAcc
8585
@Input() size: Size = Size.Small;
8686
@Input() appearance: Appearance = Appearance.Legacy;
8787
@Input() withMargin = true;
88+
@Input() withHint = true;
8889
@Input() textareaRows = 1;
8990

9091
@Input()

projects/swimlane/ngx-ui/src/lib/components/json-editor/json-editor-flat/json-editor-node-flat/json-editor-node-flat.component.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,19 @@ ngx-json-editor-node-flat {
124124

125125
.node-input {
126126
flex: 0 1 60%;
127-
padding-top: 5px;
128-
margin-bottom: 2px;
129127

130128
ngx-input {
131129
padding: var(--spacing-0);
132-
margin: var(--spacing-0);
133130

134131
.ngx-input-hint {
135132
min-height: 0;
136133
}
137134
}
138135

136+
ngx-select {
137+
margin-top: var(--spacing-36);
138+
}
139+
139140
.code {
140141
&:hover {
141142
button {

projects/swimlane/ngx-ui/src/lib/components/json-editor/json-editor-flat/json-editor-node-flat/node-types/array-node-flat/array-node-flat.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
>
4040
<i class="ngx-icon ngx-cog"></i>
4141
</button>
42-
<ngx-dropdown [showCaret]="true">
42+
<ngx-dropdown>
4343
<ngx-dropdown-toggle>
4444
<button type="button" class="node-options-btn">
4545
<i class="ngx-icon ngx-dots-vert-round"></i>
4646
</button>
4747
</ngx-dropdown-toggle>
48-
<ngx-dropdown-menu class="ngx-dropdown-dark-outline align-right">
48+
<ngx-dropdown-menu class="ngx-dropdown-menu align-right">
4949
<ul class="vertical-list">
5050
<li><button type="button" (click)="deleteArrayItem(i)">Delete</button></li>
5151

@@ -74,14 +74,14 @@
7474
[style.marginLeft]="hideRoot && level === 0 ? '15px' : '0'"
7575
[style.backgroundColor]="level === 0 ? '' : 'rgba(49,56,71,0.5)'"
7676
>
77-
<ngx-dropdown [showCaret]="true">
77+
<ngx-dropdown>
7878
<ngx-dropdown-toggle>
7979
<button [disabled]="isDuplicated" type="button">
8080
<i class="ngx-icon ngx-tree-expand"></i>
8181
<span>Add an item</span>
8282
</button>
8383
</ngx-dropdown-toggle>
84-
<ngx-dropdown-menu class="ngx-dropdown-dark-outline">
84+
<ngx-dropdown-menu class="ngx-dropdown-menu">
8585
<ul class="vertical-list">
8686
<ng-template [ngIf]="!schema || !schema.items || !schema.items.type">
8787
<li *ngFor="let dataType of dataTypes" (click)="addArrayItem(dataType)">

projects/swimlane/ngx-ui/src/lib/components/json-editor/json-editor-flat/json-editor-node-flat/node-types/node-types.extensions.scss

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,26 @@
6767
span {
6868
font-size: var(--font-size-s);
6969
margin-left: var(--spacing-10);
70+
line-height: var(--font-line-height-100);
7071
}
7172
}
7273

73-
.ngx-dropdown-menu {
74-
@extend %ngx-dropdown-menu;
74+
.ngx-dropdown {
75+
.ngx-dropdown-menu {
76+
button {
77+
display: unset;
78+
color: unset;
79+
80+
i {
81+
font-size: unset;
82+
}
83+
84+
span {
85+
font-size: unset;
86+
margin-left: unset;
87+
}
88+
}
89+
}
7590
}
7691
}
7792
}

0 commit comments

Comments
 (0)