Skip to content

Commit

Permalink
fix(link): remove icon part
Browse files Browse the repository at this point in the history
  • Loading branch information
dpellier committed Jul 29, 2024
1 parent 3484013 commit 9a9c521
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export class OdsLink {
</span>

{
!!this.icon && <ods-icon part="icon" name={ this.icon } class="ods-link__link__icon"></ods-icon>
!!this.icon &&
<ods-icon
class="ods-link__link__icon"
name={ this.icon }>
</ods-icon>
}
</a>
</Host>
Expand Down
12 changes: 0 additions & 12 deletions packages/ods/src/components/link/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,11 @@
<ods-link class="my-link" href="test" label="link custom css">
</ods-link>

<p>Custom CSS with icon</p>
<ods-link class="my-link-icon" href="test" label="link custom css icon" icon="warning">
</ods-link>

<style>
.my-link::part(link) {
color: green;
font-size: 32px;
}

.my-link-icon::part(link) {
font-size: 32px;
}
.my-link-icon::part(icon) {
width: 2rem;
height: 2rem;
}
</style>
</body>
</html>
6 changes: 0 additions & 6 deletions packages/storybook/stories/components/link/documentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ Custom link css:

<Canvas of={ LinkStories.CustomCSSLink } sourceState='shown'/>

You can add your own style on the icon link element using the part `icon`.

Custom icon css:

<Canvas of={ LinkStories.CustomCSSLinkIcon } sourceState='shown'/>

# Examples

## Usage
Expand Down
13 changes: 0 additions & 13 deletions packages/storybook/stories/components/link/link.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,3 @@ export const CustomCSSLink: StoryObj = {
</style>
`,
}

export const CustomCSSLinkIcon: StoryObj = {
tags: ['isHidden'],
render: () => html`
<ods-link class="my-link-icon" href="/page" label="Content" icon="warning"></ods-link>
<style>
.my-link-icon::part(icon) {
width: 2rem;
height: 2rem;
}
</style>
`,
};

0 comments on commit 9a9c521

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy