Skip to content

Commit

Permalink
fix(link): fix style of Link (#1619)
Browse files Browse the repository at this point in the history
Co-authored-by: maxin <maxin@growingio.com>
  • Loading branch information
nnmax and maxin authored Dec 6, 2021
1 parent ad0c1f3 commit af39027
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/link/demos/Link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Template: Story<LinkProps> = (args) => (
);
export const Demo = Template.bind({});
Demo.args = {
href: '',
href: '//www.growingio.com',
style: {
margin: '4px 8px',
},
Expand All @@ -82,23 +82,23 @@ const LinkTemplate: Story<LinkProps> = (args) => <Link {...args}>GrowingIO</Link

export const Default = LinkTemplate.bind({});
Default.args = {
href: '',
href: '//www.growingio.com',
};

export const Disable = LinkTemplate.bind({});
Disable.args = {
href: '',
href: '//www.growingio.com',
disabled: true,
};

export const Loading = LinkTemplate.bind({});
Loading.args = {
href: '',
href: '//www.growingio.com',
loading: true,
};

export const IconLink = LinkTemplate.bind({});
IconLink.args = {
href: '',
href: '//www.growingio.com',
prefix: <PlusOutlined />,
};
26 changes: 22 additions & 4 deletions src/link/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,33 @@
@link-prefix-cls: ~'@{component-prefix}-link';

.@{link-prefix-cls} {
.reset() {
margin: 0;
text-decoration: none;
border: 0;
border-radius: 0;
outline: 0;
-webkit-appearance: none;
}
box-sizing: border-box;
color: @blue-2;
.text-body1();
text-decoration: none;
cursor: pointer;
.text-body1();
.reset();

&:not([aria-disabled='true']):hover {
&::-moz-focus-inner {
border-style: none;
}

&:not([aria-disabled='true']):hover,
&:not([aria-disabled='true']):active,
&:not([aria-disabled='true'], :focus-visible):focus {
color: @blue-3;
text-decoration: none;
.reset();
}
&:not([aria-disabled='true']):focus-visible {
color: @blue-3;
outline: auto;
}

&_loading {
Expand Down

1 comment on commit af39027

@vercel
Copy link

@vercel vercel bot commented on af39027 Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.