Skip to content

fix(link): improve ionic theme links styles and dev experience #30375

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

Merged
merged 9 commits into from
Apr 30, 2025
Merged
Changes from 1 commit
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
Next Next commit
fix link styles
  • Loading branch information
BenOsodrac committed Apr 29, 2025
commit 54c5993ddeabd41b9d28fd7bec374b7eae67eb37
72 changes: 29 additions & 43 deletions core/src/css/ionic/link.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,46 +25,49 @@
&:visited {
color: globals.$ion-text-link-visited;
}
}

// Link: Standalone
// -------------------------------------------------------------------------------
// Link: Focus
// -------------------------------------------------------------------------------

@mixin ionic-link {
color: globals.$ion-text-link-default;
&:focus,
&.ion-focused {
@include globals.focused-state();

text-decoration: none;
border-radius: globals.$ion-border-radius-100;
}

@include link-shared;
// Link: Active
// -------------------------------------------------------------------------------

&:active,
&.ion-activated {
color: globals.$ion-text-link-press;

// Link: Standalone - Hover
text-decoration: underline;
}

// Link: Hover
// -------------------------------------------------------------------------------

@media (any-hover: hover) {
&:hover {
color: globals.$ion-text-link-press;

text-decoration: underline;
}
}

// Link: Standalone - Focus
// -------------------------------------------------------------------------------

&:focus,
&.ion-focused {
@include globals.focused-state(null, null, globals.$ion-text-link-default);
}

text-decoration: underline;
}
// Link: Standalone
// -------------------------------------------------------------------------------

// Link: Standalone - Active
// -------------------------------------------------------------------------------
@mixin ionic-link {
color: globals.$ion-text-link-default;

&:active,
&.ion-activated {
color: globals.$ion-text-link-press;
text-decoration: none;

text-decoration: underline;
}
@include link-shared;
}

a.ionic-link,
Expand All @@ -76,38 +79,21 @@ a.ionic-link,
// -------------------------------------------------------------------------------

@mixin ionic-link-underline {
color: currentColor;
color: globals.$ion-text-default;

text-decoration: underline;

@include link-shared;

// Link: Underline - Hover
// -------------------------------------------------------------------------------

@media (any-hover: hover) {
&:hover {
color: globals.$ion-text-link-press;
}
}

// Link: Underline - Focus
// Link: Focus
// -------------------------------------------------------------------------------

&:focus,
&.ion-focused {
@include globals.focused-state(null, null, globals.$ion-text-link-default);
color: globals.$ion-text-default;

text-decoration: none;
}

// Link: Underline - Active
// -------------------------------------------------------------------------------

&:active,
&.ion-activated {
color: globals.$ion-text-link-press;
}
}

a.ionic-link-underline,
Expand Down