Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tabs): update theme according to new Indigo design #1395

Merged
merged 6 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/icon/icon-references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,20 @@ addIcon('prev', {
name: 'navigate_before',
collection: 'internal',
},
indigo: {
name: 'indigo_chevron_left',
collection: 'internal',
},
});
addIcon('next', {
default: {
name: 'navigate_next',
collection: 'internal',
},
indigo: {
name: 'indigo_chevron_right',
collection: 'internal',
},
});
addIcon('tree_expand', {
default: {
Expand Down
1 change: 1 addition & 0 deletions src/components/tabs/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ export default class IgcTabsComponent extends EventEmitterMixin<
variant="flat"
collection="default"
part="${direction}-scroll-button"
exportparts="icon"
name="${start ? 'prev' : 'next'}"
.disabled=${start
? this.disableStartScrollButton
Expand Down
2 changes: 2 additions & 0 deletions src/components/tabs/themes/dark/tab.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $bootstrap;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/dark/tab.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $fluent;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/dark/tab.indigo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $indigo;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/dark/tab.material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $material;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/light/tab.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $bootstrap;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/light/tab.fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $fluent;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/light/tab.indigo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $indigo;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
2 changes: 2 additions & 0 deletions src/components/tabs/themes/light/tab.material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ $theme: $material;

:host {
@include css-vars-from-theme(diff($base, $theme), 'ig-tabs');

--navigation-border-color: #{var-get($theme, 'border-color')};
}
34 changes: 34 additions & 0 deletions src/components/tabs/themes/shared/tab/tab.indigo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@use 'styles/utilities' as *;
@use '../../light/themes' as *;

$theme: $indigo;

:host {
--btn-hover-color: #{var-get($theme, 'button-hover-color')};

border-top: rem(1px) solid transparent;
border-bottom: rem(1px) solid var-get($theme, 'border-color');
padding-block: rem(11px);

::slotted(igc-icon) {
--ig-size: 2;

color: var-get($theme, 'item-icon-color');
}
}

:host(:hover) {
::slotted(igc-icon) {
color: var-get($theme, 'item-hover-icon-color');
}
}

:host([disabled]) {
::slotted(igc-icon) {
color: var-get($theme, 'item-disabled-icon-color');
}
}

[part='content'] {
@include type-style('subtitle-2');
}
21 changes: 21 additions & 0 deletions src/components/tabs/themes/shared/tabs/tabs.indigo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@use 'styles/utilities' as *;
@use '../../light/themes' as *;

$theme: $indigo;

[part='headers'] {
min-height: rem(40px);
}

[part='start-scroll-button'],
[part='end-scroll-button'] {
min-width: rem(40px);
width: rem(40px);
border-bottom: rem(1px) solid var(--navigation-border-color);

&:hover {
&::part(icon) {
color: var-get($theme, 'button-hover-color');
}
}
}
7 changes: 7 additions & 0 deletions src/components/tabs/themes/tab-themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Themes } from '../../../theming/types.js';
// Shared Styles
import { styles as bootstrap } from './shared/tab/tab.bootstrap.css.js';
import { styles as fluent } from './shared/tab/tab.fluent.css.js';
import { styles as indigo } from './shared/tab/tab.indigo.css.js';

const light = {
bootstrap: css`
Expand All @@ -12,6 +13,9 @@ const light = {
fluent: css`
${fluent}
`,
indigo: css`
${indigo}
`,
};

const dark = {
Expand All @@ -21,6 +25,9 @@ const dark = {
fluent: css`
${fluent}
`,
indigo: css`
${indigo}
`,
};

export const all: Themes = { light, dark };
4 changes: 4 additions & 0 deletions src/components/tabs/themes/tab.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@
::slotted(*) {
@include line-clamp(2, true, true);
}

::slotted(igc-icon) {
display: flex;
}
}
5 changes: 3 additions & 2 deletions src/components/tabs/themes/tabs-themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { styles as sharedLight } from './light/tab.shared.css.js';
// Shared Styles
import { styles as bootstrap } from './shared/tabs/tabs.bootstrap.css.js';
import { styles as fluent } from './shared/tabs/tabs.fluent.css.js';
import { styles as indigo } from './shared/tabs/tabs.indigo.css.js';

const light = {
shared: css`
Expand All @@ -31,7 +32,7 @@ const light = {
${fluent} ${fluentLight}
`,
indigo: css`
${indigoLight}
${indigo} ${indigoLight}
`,
};

Expand All @@ -49,7 +50,7 @@ const dark = {
${fluent} ${fluentDark}
`,
indigo: css`
${indigoDark}
${indigo} ${indigoDark}
`,
};

Expand Down
1 change: 1 addition & 0 deletions src/components/tabs/themes/tabs.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ igc-icon-button::part(base) {
}
}

:host-context([dir='rtl']),
:host([dir='rtl']) {
[part='start-scroll-button'],
[part='end-scroll-button'] {
Expand Down
Loading