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-9132: Add max-width limitation to all content types without sidebar except landing page #811

Merged
merged 39 commits into from
Dec 1, 2023

Conversation

teroelonen
Copy link
Contributor

@teroelonen teroelonen commented Oct 26, 2023

UHF-9132

What was done

  • In short the purpose of this PR is to limit the component--upper region to max-width of 860px like some of the elements that were already on the page.
  • I can't say this is very elegant and it still has some lists for the paragraphs that should be full width so it is not a perfect solution. If you can think of a better solution for the changes I am more than happy to listen.

How to install

  • 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-9132
  • Run make drush-cr

How to test

  • This PR should be checked with at least SOTE, KYMP, REKRY, Front page and HALLINTO instances.
  • Basically you need to check each content type with each design alternative of each paragraph that you are able to add on the page. This would obviously be too much of a task for anyone at this point so my recommendation is to do some checks by browsing the sites freely and try to see if there is some visual issues somewhere.
  • Check that the paragraphs that have gray/black bg for example go from edge to edge on mobile and work nicely on desktop.
  • Check that basic page, landing page, TPR unit and TPR service, news page, job application, district and project pages look functional. The district and project pages are KYMP specific pages and to test them you need to also checkout the KYMP specific PR linked on this PR. Also check the KASKO and REKRY specific PRs for their changes.
  • Check that code follows our standards.

Designers review

  • This PR does not need designers review
  • This PR has been visually reviewed by a designer (Sami)

Other PRs

…ar except landing page, fix padding issues for event-list, map, service-list and unit-search paragraphs
@teroelonen teroelonen changed the title UHF-9132: Add max-width limitation to all content types without sidebar except landing page, fix padding issues for event-list, map, service-list and unit-search paragraphs UHF-9132: Add max-width limitation to all content types without sidebar except landing page Oct 26, 2023
Copy link
Contributor

@khalima khalima left a comment

Choose a reason for hiding this comment

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

The functionality works. I tested these in Kasko, Sote, Kymp, Strategia and Etusivu. Found some bugs, but all should be fixed now as we checked all issues together with @teroelonen.

@Arkkimaagi Can you check these changes and approve this PR once you think all is 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.

Wow! Just WOW!

What a great job you have done! So much removed lines, cleared code and nice work!

I found some minor nitpicks (as usual), but I could not find anything major. What an exellent job!

@@ -3,7 +3,7 @@
{% block paragraph %}
{% embed "@hdbt/misc/component.twig" with
{
component_classes: [ 'component--service-list-search' ],
component_classes: [ 'component--full-width', 'component--service-list-search' ],
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend putting these on separate rows for readability and better git workflows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this 👍

@@ -4,7 +4,7 @@
{% block paragraph %}
{% embed "@hdbt/misc/component.twig" with
{
component_classes: [ 'component--unit-search' ],
component_classes: [ 'component--full-width', 'component--unit-search' ],
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend putting these on separate rows for readability and better git workflows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this 👍

@@ -1,6 +1,6 @@
{% embed "@hdbt/misc/component.twig" with
{
component_classes: [ 'component--map' ],
component_classes: [ 'component--map', 'component--full-width' ],
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend putting these on separate rows for readability and better git workflows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this 👍

src/scss/06_components/layout/_component.scss Show resolved Hide resolved
}
}

// Unit needs also these following fixed elements max-width. This should/could be fixed
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a real TODO here with ticket id to fix it at some time?

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 a TODO here and a ticket to Jira :)

max-width: $content-width-max
}

// Service needs also these following fixed elements max-width. This should/could be fixed
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a real TODO here with ticket id to fix it at some time?

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 a TODO here and a ticket to Jira :)

@@ -1,4 +1,4 @@
$-sidebar-width: 340px;
$-sidebar-width: calc(340px + $spacing-double + $spacing-double);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe explain from where these $spacing-double values come from so that the math can be adjusted if needed at some point.

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 comment above to clarify this calc.

src/scss/06_components/layout/_layout.scss Show resolved Hide resolved
padding-top: 0;

@include breakpoint($breakpoint-m) {
grid-template-columns: [full-width-start] $spacing-double [content-start] 1fr [content-end] $spacing-double [full-width-end] ;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd consider using a custom property (css variable) for the gap, so that only it changes and we do not need to define the full grid-template-columns twice. Maybe set it without the mediaquery as

grid-template-columns: [full-width-start] var(--component-gap, #{$spacing}) [content-start] 1fr [content-end] var(--component-gap, #{$spacing}) [full-width-end];

and then in the mediaquery just set --component-gap: #{$spacing-double};. This way it's easier to see what we're doing at the breakpoint and to adjust the template-columns if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was awesome! When writing this I didn't like the fact that I had to define the template columns twice but didn't think of a better solution. Thank you :) You made me a better developer again 🙇

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.

Good job! 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