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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix table mobile card top border #5005

Merged
merged 2 commits into from Mar 26, 2024
Merged

Conversation

britneywwc
Copy link
Contributor

@britneywwc britneywwc commented Feb 23, 2024

Done

  • Fixed the issue where top border wasn't consistent with the other border sides

Fixes #5001, WD-9104

QA

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 馃巵, Breaking Change 馃挘, Bug 馃悰, Documentation 馃摑, Maintenance 馃敤.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.

Screenshots

0 0 0 0_8101_docs_examples_patterns_tables_table-mobile-card

0 0 0 0_8101_docs_examples_patterns_tables_table-mobile-card-dark

@webteam-app
Copy link

Demo starting at https://vanilla-framework-5005.demos.haus

@@ -45,7 +45,7 @@
}

tr {
border-bottom: 1px solid $colors--theme--border-default;
border-bottom: $input-border-thickness solid $colors--theme--border-default;
Copy link
Contributor

@bartaz bartaz Feb 26, 2024

Choose a reason for hiding this comment

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

@lyubomir-popov Is this OK to use $input-border-thickness for table rows, or is it reserved to other (interactive) elements?

@@ -71,6 +71,6 @@
// stylelint-enable selector-max-type

%table-row-border {
border-top: 1px solid $colors--theme--border-low-contrast;
border-top: $input-border-thickness solid $colors--theme--border-default;
Copy link
Contributor

Choose a reason for hiding this comment

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

@britneywwc Why changing this to $input-border-thickness?

Overall the fix works fine, but I'm worried that changing the width of the border on ALL rows may affect other things.

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 tried to match the border thickness with the table-mobile-card's border which inherits from $border.

Would it be better to change it in p-table--mobile-card rather than %table-row-border so that it uses the same border thickness (1px) as the previous table rows? Just so it won't affect other things and only change within the table-mobile-card component.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think we need to treat it separate from standard table row border.

In mobile card small screen view we want those to look like card component, so the border around each card (row) should be the same as in card, so as you mentioned it should be $border

As in:

  %vf-is-bordered {
    border: $border;
  }

@@ -71,6 +71,6 @@
// stylelint-enable selector-max-type

%table-row-border {
border-top: 1px solid $colors--theme--border-low-contrast;
border-top: 1px solid $colors--theme--border-default;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to stay as -low-contrast or otherwise all row borders in all columns become move visible than they are now.

Copy link
Contributor

@bartaz bartaz left a comment

Choose a reason for hiding this comment

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

Thanks @britneywwc.

I applied some small changes to clean up the last issues (it turns out the main problem was specificity of the card styling).

@bartaz bartaz merged commit 404367d into canonical:main Mar 26, 2024
5 checks passed
@britneywwc britneywwc deleted the table-mobile-cards branch March 27, 2024 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top border of table mobile card is different
3 participants