Skip to content

Commit deca143

Browse files
committed
feat(tile-manager): resize indicator styling
1 parent 4d2f6bf commit deca143

File tree

7 files changed

+84
-110
lines changed

7 files changed

+84
-110
lines changed

src/components/resize-container/resize-container.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { partNameMap } from '../common/util.js';
99
import IgcIconComponent from '../icon/icon.js';
1010
import { addResizeController } from './resize-controller.js';
1111
import { styles } from './themes/resize-container.base.css.js';
12+
import { styles as shared } from './themes/shared/resize-container.common.css.js';
1213
import type {
1314
ResizeCallbackParams,
1415
ResizeGhostFactory,
@@ -35,7 +36,7 @@ export default class IgcResizeContainerComponent extends EventEmitterMixin<
3536
Constructor<LitElement>
3637
>(LitElement) {
3738
public static readonly tagName = 'igc-resize';
38-
public static styles = [styles];
39+
public static styles = [styles, shared];
3940

4041
/* blazorSuppress */
4142
public static register(): void {
@@ -188,9 +189,9 @@ export default class IgcResizeContainerComponent extends EventEmitterMixin<
188189
}
189190

190191
return html`
191-
<div ${ref(this._adorners.side)} part="trigger-side">🔵</div>
192-
<div ${ref(this._adorners.corner)} part="trigger">🔵</div>
193-
<div ${ref(this._adorners.bottom)} part="trigger-bottom">🔵</div>
192+
<div ${ref(this._adorners.side)} part="trigger-side"></div>
193+
<div ${ref(this._adorners.corner)} part="trigger"></div>
194+
<div ${ref(this._adorners.bottom)} part="trigger-bottom"></div>
194195
`;
195196
}
196197

src/components/resize-container/themes/resize-container.base.scss

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,12 @@
11
@use 'styles/common/component';
22
@use 'styles/utilities' as *;
33

4-
:host {
5-
--resize-visibility: visible;
6-
7-
display: contents;
8-
}
9-
10-
[part~='resize-base'] {
11-
position: relative;
12-
height: 100%;
13-
}
14-
15-
@media(hover: hover) and (pointer: fine) {
16-
[part~='active'] {
17-
outline: 2px solid #0047AB
18-
}
19-
}
20-
21-
[part~='active'] {
22-
outline: 2px solid #0047AB
23-
}
4+
%indicator {
5+
--_size: #{rem(11px)};
246

25-
[part='trigger-side'] {
267
display: inline-flex;
278
visibility: var(--resize-visibility);
28-
cursor: e-resize;
299
position: absolute;
30-
top: calc(50% - rem(12px));
31-
right: rem(-12px);
3210
z-index: 1;
3311

3412
igc-icon {
@@ -38,44 +16,52 @@
3816
--ig-icon-size: #{$icon-size};
3917
--igx-icon-size: #{$icon-size};
4018
}
19+
20+
&::after {
21+
content: '';
22+
position: absolute;
23+
top: 0;
24+
right: 0;
25+
bottom: 0;
26+
left: 0;
27+
width: var(--_size);
28+
height: var(--_size);
29+
border-radius: 50%;
30+
z-index: 1;
31+
}
4132
}
4233

43-
[part='trigger'] {
44-
display: inline-flex;
45-
visibility: var(--resize-visibility);
46-
cursor: se-resize;
47-
position: absolute;
48-
bottom: rem(-12px);
49-
right: rem(-12px);
50-
z-index: 1;
34+
:host {
35+
display: contents;
36+
}
5137

52-
igc-icon {
53-
$icon-size: rem(9px);
38+
[part~='resize-base'] {
39+
position: relative;
40+
height: 100%;
41+
}
5442

55-
--size: #{$icon-size} !important;
56-
--ig-icon-size: #{$icon-size};
57-
--igx-icon-size: #{$icon-size};
58-
}
43+
[part='trigger-side'],
44+
[part='trigger'],
45+
[part='trigger-bottom'] {
46+
@extend %indicator;
5947
}
6048

49+
[part='trigger-side'] {
50+
top: calc(50% - var(--_size));
51+
right: calc(var(--_size) / 2);
52+
cursor: e-resize;
53+
}
6154

55+
[part='trigger'] {
56+
bottom: calc(var(--_size) / 2);
57+
right: calc(var(--_size) / 2);
58+
cursor: se-resize;
59+
}
6260

6361
[part='trigger-bottom'] {
64-
display: inline-flex;
65-
visibility: var(--resize-visibility);
62+
left: calc(50% - var(--_size));
63+
bottom: calc(var(--_size) / 2);
6664
cursor: s-resize;
67-
position: absolute;
68-
left: calc(50% - rem(12px));
69-
bottom: rem(-12px);
70-
z-index: 1;
71-
72-
igc-icon {
73-
$icon-size: rem(9px);
74-
75-
--size: #{$icon-size} !important;
76-
--ig-icon-size: #{$icon-size};
77-
--igx-icon-size: #{$icon-size};
78-
}
7965
}
8066

8167
[part='trigger']:focus {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@use 'styles/utilities' as *;
2+
@use '../../../tile-manager/themes/light/themes' as *;
3+
4+
$theme: $material;
5+
6+
[part~='active'] {
7+
&::after {
8+
content: '';
9+
position: absolute;
10+
pointer-events: none;
11+
inset: 0;
12+
width: 100%;
13+
height: 100%;
14+
border-radius: var-get($theme, 'border-radius');
15+
border: rem(1px) solid var-get($theme, 'hover-border-color');
16+
}
17+
}
18+
19+
[part='trigger-side'],
20+
[part='trigger'],
21+
[part='trigger-bottom'] {
22+
&::after {
23+
background: var-get($theme, 'resize-indicator');
24+
}
25+
}

src/components/tile-manager/themes/resize.base.scss

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/components/tile-manager/themes/shared/resize.common.scss

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/tile-manager/themes/shared/tile/tile.common.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ $theme: $material;
1111
background: var-get($theme, 'tile-background');
1212
border-radius: var-get($theme, 'border-radius');
1313
box-shadow: var-get($theme, 'resting-elevation');
14+
}
1415

16+
[part~='base']:not([part~='resizable']) {
1517
&:hover {
1618
&::after {
1719
content: '';

src/components/tile-manager/themes/tile.base.scss

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
@use 'styles/utilities' as *;
33

44
:host {
5+
--pad-block: #{sizable(rem(8px), rem(13px), rem(13px))};
6+
--pad-inline: #{sizable(rem(12px), rem(16px), rem(20px))};
7+
58
display: block;
69
position: relative;
710
grid-column: var(--ig-col-start, auto) / span var(--ig-col-span, 1);
811
grid-row: var(--ig-row-start, auto) / span var(--ig-row-span, 1);
912
}
1013

11-
:host(:hover) {
12-
igc-resize {
13-
--resize-visibility: visible;
14-
}
15-
}
16-
1714
:host([part='resizing']),
1815
:host([part='dragging']) {
1916
background: var(--placeholder-background);
@@ -82,9 +79,9 @@
8279
}
8380

8481
:host(:not([disable-fullscreen][disable-maximize])) {
85-
[part='header'] {
86-
padding-block: sizable(rem(8px), rem(13px), rem(13px));
87-
padding-inline: sizable(rem(12px), rem(16px), rem(20px));
82+
[part='actions'] {
83+
padding-block: var(--pad-block);
84+
padding-inline: var(--pad-inline);
8885
}
8986
}
9087

@@ -104,9 +101,17 @@
104101

105102
margin-bottom: 0;
106103
min-width: 2ch;
104+
padding-block: var(--pad-block);
105+
padding-inline: var(--pad-inline);
107106
}
108107

109108
[part='actions'] {
110109
display: flex;
111110
gap: rem(8px);
112111
}
112+
113+
// should be fixed
114+
::slotted([slot='actions']) {
115+
padding-block: var(--pad-block);
116+
padding-inline: var(--pad-inline);
117+
}

0 commit comments

Comments
 (0)