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

UHF-9866: Arrow and underline refactoring #1101

Merged
merged 26 commits into from
Nov 6, 2024
Merged

UHF-9866: Arrow and underline refactoring #1101

merged 26 commits into from
Nov 6, 2024

Conversation

teroelonen
Copy link
Contributor

@teroelonen teroelonen commented Nov 1, 2024

UHF-9866

What was done

  • Make all links underlined with 1px underline and 10% underline offset by default.
  • Add underline that scales to 2px on hover for links.
  • Remove arrows from cards, content cards, list of links, popular services and target group links.
  • Move the external link icon inline with the link text on elements where it wasn't so before.
  • Changed popular services to list the links as ul-list.

How to install

Other instances than Etusivu, KYMP or KASKO

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the HDBT theme
    • composer require drupal/hdbt:dev-UHF-9866
  • Run make drush-cr

Etusivu, KYMP and KASKO

  • Checkout the instance specific feature branch
    • git fetch && git checkout UHF-9866
    • make fresh
  • Update the HDBT theme
    • composer require drupal/hdbt:dev-UHF-9866
  • Run make drush-cr

How to test

It might be easiest to start with Etusivu instance since most of the components are used there on the front page and then move to KYMP and KASKO that have few special cases. There is a link after each component to find one example of them. You can also create a test page with the components if that is easier to test for you.

Continuous documentation

  • This feature has been documented/the documentation has been updated
  • This change doesn't require updates to the documentation

Other PRs

Copy link

github-actions bot commented Nov 1, 2024

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/1101/html_report/

Copy link

github-actions bot commented Nov 1, 2024

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/1101/html_report/

@annadruid
Copy link
Contributor

Looks good!

One thing from etusivu instance:

  • "List of links with pictures", should they have the bullet points? At least for me they show up without them, but then again it might be a copy paste error in the instructions since bullet points in this element would look a bit odd :D
Screenshot 2024-11-04 at 12 35 09

For all the instances:

  • Should the thicker underline also work when the link is focused with keyboard?

Copy link
Contributor

@Arkkimaagi Arkkimaagi left a comment

Choose a reason for hiding this comment

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

I checked the code first to give you time to check it out while I'm clikcing the functional stuff.

The code looks clean, but I was as usual, a bit nit picky on some details. You can check what you think about these things and we can discuss further. Good stuff nonetheless, it's great to see progress on this field after such a long time of discussions. Good job!

I'll get back about the rest of the PR after I've clicked it through.

src/scss/02_mixins/_link_mixins.scss Outdated Show resolved Hide resolved
src/scss/04_elements/_typography.scss Outdated Show resolved Hide resolved

// Make the clickable area conform with WCAG AAA standard and adjust the text slightly higher than
// the center to make it look balanced.
padding-bottom: calc($-item-link-padding * 0.6667);
Copy link
Contributor

Choose a reason for hiding this comment

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

Explain these magic numbers. Preferrably calculate them using the $wcag-touch-target-size-aa or $wcag-touch-target-size-aaa

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added better explanation :)


@include breakpoint($breakpoint-s) {
display: block;
min-height: calc(get-line-height('h4.breakpoint_l', $unremify: true) + $spacing-quadruple);
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Why use calc here instead of calculating it in scss?
  • Can you clarify why you're adding $spacing-quadruple to line-height?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I adjusted these min-heights quite a bit and commented them more clearly so can you check them again 🙏

text-decoration: none;
}
// Make the clickable area conform with WCAG AAA standard.
padding-block: calc($-item-link-padding * 0.5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you using calc to calculate something in browser that scss could calculate already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the calcuation to the top and removed the calc-function.


// The padding below it are used to make the link correct minimum height for the WCAG AAA standard.
padding-block: $-service-item-padding;
padding-left: $spacing-quarter;
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use padding-inline-start to handle the dir=rtl situation automatically without the need for padding-left: 0 later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this now but I think we actually have an issue with this. It seems to be that our compiler converts padding-inline-start to padding-left and that shouldn't happen because the whole thing stops working if it does that. I checked the compiled css and for me it does that at least. Lets investigate this!

@teroelonen
Copy link
Contributor Author

teroelonen commented Nov 4, 2024

@annadruid No bullet points for list of links with images 😄 just my copy-paste-mistake.

Should the thicker underline also work when the link is focused with keyboard?

I am not quite sure but I think it should be at least logical. I will change it so that everywhere where the link is underlined the focus gets the thicker underline as well.

Copy link

github-actions bot commented Nov 4, 2024

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/1101/html_report/

Copy link

github-actions bot commented Nov 4, 2024

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/1101/html_report/

Copy link

github-actions bot commented Nov 5, 2024

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/1101/html_report/

Copy link
Contributor

@annadruid annadruid left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@Arkkimaagi Arkkimaagi left a comment

Choose a reason for hiding this comment

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

Approved 🌹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants