-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Create a no-link-underline
CSS helper
#324
Comments
Currently, the Ember Styleguide provides the However, the helper works only for links scoped to the ember-styleguide/addon/styles/global.css Line 153 in 8bf40f8
All other links use ember-styleguide/addon/styles/global.css Line 141 in 8bf40f8
So, there are 3 solutions for this issue:
.no-link-underline
.no-link-underline:link,
.no-link-underline:visited {
background: none;
text-decoration: none;
} |
Per the discussion with @mansona , option 1 looks better. However, we need to be cautious not to break the existing apps. |
So there is another way of thinking about this whole situation 🤔 I happen to agree with the default styles being applied to main. Sure we could extend it to be in all cases but that then goes against the point of why it was only applied to main, we want to be able to have default link styles for the main content of the site and have them not apply to the nav or the footer. For this reason I don't think we should be doing option 1. I think the best way forward would be to go for option 2. but for us to use a "deprecation" methodology, so we should be able to use either the new class Does that make sense? |
Thank you for looking at this, @mansona ! Looking at this again, I've realized that all of these solutions have their own pros and cons. Using Overall, the issue happens since we have two ways of making text underlined (using Here is the simplified version of our styles: /* Underline links by default using `text-decoration`. */
a {
text-decoration: underline;
}
/* Underline links inside <main> using `background`. */
main a {
text-decoration: none;
background: no-repeat left bottom
linear-gradient(var(--color-brand-40), var(--color-brand-40));
background-size: 100% 0.1875rem;
}
/* The helper handles only `background`-based underlines. */
.bg-none,
.bg-none a {
background: none;
} Option 1: Use only
|
background-image: none; |
background-image: none; |
So, I would recommend to consider this approach as a long-term solution.
@pichfl , please, could you have a look a this and let us know you opinion? You was an author of some related changes (85e0489) and don't want to miss something important.
Thank you!
I just happened to run into this in another commit in which Note: |
There are enough cases where we would like to be able to turn off the default link underline behaviour in designs that it makes sense for us to add a helper that sets
background: none
to overcome this for us.You can see a good example of the need for this helper in the discussion on ember-learn/empress-blog-ember-template#26
If you implement this helper you will need to make sure that it is documented 👍
The text was updated successfully, but these errors were encountered: