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(experimental): Surface add new directive #5555

Merged
merged 15 commits into from
Oct 11, 2023
Merged
3 changes: 2 additions & 1 deletion projects/addon-charts/components/axes/axes.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
}

.t-grid {
.createStackingContext();
position: relative;
display: flex;
flex: 1;
justify-content: space-around;
align-items: flex-end;
border-width: 1px;
border-color: var(--tui-base-03);
isolation: isolate;

:host[data-mode='onDark'] & {
border-color: rgba(255, 255, 255, 0.48);
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-doc/components/main/main.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ a:focus code {
}

.tui-doc-page {
.createStackingContext();
isolation: isolate;
padding-top: 4rem;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
}

.t-content {
.createStackingContext();
position: relative;
isolation: isolate;

&:nth-child(3) {
margin-top: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion projects/core/components/button/button.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@
}

.t-wrapper {
.createStackingContext();
box-sizing: border-box;
cursor: pointer;
isolation: isolate;

:host[data-size='xs'] & {
padding: 0 var(--tui-padding, @padding-xs);
Expand Down
3 changes: 2 additions & 1 deletion projects/core/components/group/group.style.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@import '../../styles/taiga-ui-local';

.tui-group {
.createStackingContext();
position: relative;
display: flex;
isolation: isolate;

& > * {
flex: 1 1 0;
Expand Down
2 changes: 1 addition & 1 deletion projects/core/components/root/root.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ tui-root > .t-root-scrollbar {
}

.t-root-content {
.createStackingContext();
height: 100%;
isolation: isolate;
}

// TODO: Required by Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1845264
Expand Down
4 changes: 2 additions & 2 deletions projects/core/components/scrollbar/scrollbar.style.less
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import '../../styles/taiga-ui-local.less';

:host {
.createStackingContext();
position: relative;
display: flex;
isolation: isolate;
overflow: auto;

&:not(._legacy) {
Expand All @@ -27,7 +27,7 @@
}

.t-content {
.createStackingContext();
isolation: isolate;
flex: 1;
flex-basis: auto;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe(`SVG options`, () => {
const myCustomPrefix = `icons8::`;

return String(src).startsWith(myCustomPrefix)
? `assets/icons8/${String(src).replace(
? `assets/icons/${String(src).replace(
myCustomPrefix,
``,
)}.svg`
Expand All @@ -239,8 +239,8 @@ describe(`SVG options`, () => {
fixture?.detectChanges();

expect(testComponent?.svgComponent.isInnerHTML).toBe(true);
expect(testComponent?.svgComponent.src).toBe(`assets/icons8/android.svg`);
expect(testComponent?.svgComponent.use).toBe(`#assets/icons8/android.svg`);
expect(testComponent?.svgComponent.src).toBe(`assets/icons/android.svg`);
expect(testComponent?.svgComponent.use).toBe(`#assets/icons/android.svg`);
});

it(`tuiIconTdsSuperIcon and TUI_SVG_SRC_PROCESSOR should be ignored`, () => {
Expand Down Expand Up @@ -308,7 +308,7 @@ describe(`SVG options`, () => {
tuiSvgOptionsProvider({path: `assets/default-path-to-icons/`}),
tuiSvgSrcInterceptors((src: TuiSafeHtml) =>
String(src).startsWith(`icons8::`)
? `assets/icons8/${String(src).replace(`icons8::`, ``)}.svg`
? `assets/icons/${String(src).replace(`icons8::`, ``)}.svg`
: src,
),
tuiSvgSrcInterceptors((src: TuiSafeHtml) =>
Expand All @@ -333,7 +333,7 @@ describe(`SVG options`, () => {
fixture?.detectChanges();

expect(testComponent?.svgComponent.isInnerHTML).toBe(true);
expect(testComponent?.svgComponent.src).toBe(`assets/icons8/android.svg`);
expect(testComponent?.svgComponent.src).toBe(`assets/icons/android.svg`);
});

it(`tuiIconTdsSuperToken`, () => {
Expand Down
2 changes: 1 addition & 1 deletion projects/core/directives/dropdown/dropdown.style.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../../styles/taiga-ui-local.less';

:host {
.createStackingContext();
.shadow(2);
position: absolute;
display: flex;
Expand All @@ -12,6 +11,7 @@
box-sizing: border-box;
/* stylelint-disable-next-line */
max-width: calc(100% - 8px); // Comes from JS so in pixels
isolation: isolate;
pointer-events: auto; // if custom portal host has pointer events none

&.ng-animating {
Expand Down
3 changes: 2 additions & 1 deletion projects/core/styles/mixins/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
}

// transition
.transition(@param, @speed: var(--tui-duration, 300ms)) {
.transition(@param: all, @speed: var(--tui-duration, 300ms)) {
transition-property: @param;
transition-duration: @speed;
transition-timing-function: ease-in-out;
Expand Down Expand Up @@ -312,6 +312,7 @@
}
}

// @deprecated use isolation: isolate instead
.createStackingContext() {
position: relative;
z-index: 0;
Expand Down
1 change: 1 addition & 0 deletions projects/core/styles/mixins/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
}
}

// @deprecated use isolation: isolate instead
@mixin createStackingContext() {
position: relative;
z-index: 0;
Expand Down
3 changes: 2 additions & 1 deletion projects/core/styles/mixins/picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
}

.t-row {
.createStackingContext();
position: relative;
display: flex;
justify-content: space-between;
height: 2.25rem;
isolation: isolate;
}

.t-item {
Expand Down
3 changes: 2 additions & 1 deletion projects/core/styles/mixins/picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
}

.t-row {
@include createStackingContext();
position: relative;
display: flex;
justify-content: space-between;
height: 2.25rem;
isolation: isolate;
}

.t-item {
Expand Down
124 changes: 124 additions & 0 deletions projects/demo/src/assets/images/gas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading