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: back top style #ASM-14132 #489

Merged
merged 2 commits into from
Aug 10, 2023
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
5 changes: 5 additions & 0 deletions .changeset/thirty-knives-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/ui": patch
---

feat: optimizing back-to-top style
17 changes: 12 additions & 5 deletions src/back-top/back-top.component.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<div
class="aui-back-top"
(click)="handleClick($event)"
[class.show]="isDisplayed$ | async"
>
<aui-icon
icon="arrow_up_to_line"
class="aui-back-top__icon"
></aui-icon>
<button
aui-button="text"
[square]="true"
[plain]="true"
(click)="handleClick($event)"
size="small"
>
<aui-icon
icon="arrow_up_to_line"
class="aui-back-top__icon"
></aui-icon>
</button>
</div>
18 changes: 1 addition & 17 deletions src/back-top/back-top.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,15 @@ $block: 'aui-back-top';

height: use-var(inline-height-m);
width: use-var(inline-height-m);
color: use-rgb(n-4);
font-size: use-var(font-size-l);
border: 1px solid transparent;
border-radius: use-var(border-radius-m);
overflow: hidden;
visibility: hidden;
cursor: pointer;
fengtianze marked this conversation as resolved.
Show resolved Hide resolved
@include popper-shadow;
@include transition;

@include theme-light {
background-color: use-rgb(n-10);
}
@include theme-dark {
background-color: use-rgb(n-8);
}
background-color: use-rgb(n-10);

&.show {
visibility: visible;
}

&:hover {
color: use-rgb(primary);
border-color: use-rgb(primary);
background-color: use-rgb(p-6);
box-shadow: none;
}
}
2 changes: 1 addition & 1 deletion src/back-top/back-top.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class BackTopComponent {
}

handleClick(event: Event) {
this.scrollToTop(300);
this.scrollToTop(200);
this.click.emit(event);
}

Expand Down
3 changes: 2 additions & 1 deletion src/back-top/back-top.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { NgModule } from '@angular/core';
import { IconModule } from '../icon/icon.module';

import { BackTopComponent } from './back-top.component';
import { ButtonModule } from '../button/button.module';

@NgModule({
imports: [CommonModule, IconModule],
imports: [CommonModule, IconModule, ButtonModule],
declarations: [BackTopComponent],
exports: [BackTopComponent],
})
Expand Down
3 changes: 2 additions & 1 deletion stories/back-top/inscroll.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
import InscrollComponent from './inscroll.component';

import { BackTopModule, ScrollingModule } from '@alauda/ui';
import { CdkScrollableModule } from '@angular/cdk/scrolling';

const meta: Meta<InscrollComponent> = {
title: 'Example/Back Top',
component: InscrollComponent,
decorators: [
moduleMetadata({
declarations: [InscrollComponent],
imports: [BackTopModule, ScrollingModule],
imports: [BackTopModule, ScrollingModule, CdkScrollableModule],
}),
],
};
Expand Down
Loading