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

Refactor Card component #180

Merged
merged 28 commits into from
Jul 2, 2024
Merged

Refactor Card component #180

merged 28 commits into from
Jul 2, 2024

Conversation

mks-h
Copy link
Member

@mks-h mks-h commented Apr 23, 2024

The Card component practically has 4 copies of its content with minor variations, so I have started refactoring it.

@mks-h mks-h force-pushed the card branch 3 times, most recently from ff92a32 to 1125759 Compare April 25, 2024 21:57
@mks-h
Copy link
Member Author

mks-h commented May 9, 2024

@mirkobrombin

The "adv" type of Card uses a pair of <h4> and <h2> tags to divide a sentence. I believe this is a non-semantic use of headings that breaks the following usage notes from MDN:

  • Do not use heading elements to resize text. Instead, use the CSS font-size property.
  • Do not skip heading levels: always start from <h1>, followed by <h2> and so on.

image

Other types of cards use <h3> tags. Given that both types are usually used at the same level, I think it is a good idea to use a single <h3> tag for both lines of "adv" card (using <br> and ::first-line to achieve the same look). Is that alright with you?

Edit: The illustration doesn't actually use the Card component, but the point stands for both.

@mirkobrombin
Copy link
Member

Mmh that looks an oversight by me. Yes, your solution is fine.

@mks-h
Copy link
Member Author

mks-h commented May 11, 2024

There's some visual change with the new h3 adv cards, which I think is fine if not better:

Old VS New

image image

image image

In context:

Old

image

New:

image

Old:

image

New:

image

@mirkobrombin
Copy link
Member

I like the new margins

@mks-h mks-h force-pushed the card branch 3 times, most recently from ab54153 to 0cac8b1 Compare May 12, 2024 19:40
@mks-h mks-h mentioned this pull request May 20, 2024
@mks-h mks-h force-pushed the card branch 4 times, most recently from 1668a82 to 42c7054 Compare June 29, 2024 08:09
mks-h added 12 commits June 29, 2024 12:41
A class of "badges-item--undefined" is no
longer set if the badge color is undefined.
If title of a footer action is not provided (like at "/team"),
an empty "span" element for it is no longer rendered.
Only renders "card actions" if the card is either "clickable" or has
"actions" property set. Notice that there is currently no use of the
"actions" property.
Card component has both "image" and "icon" properties to specify the
source, and "imageAsIcon" makes it sound like "image" source will be
used for an icon, while it is the other way around.
Instead of "title2" property, use array of 2 strings with the "title"
property. If multiline title is used, alt text now joins lines with a
space, instead of using the first line.
CardContent's link now supports external links for "adv" button. If no
link is provided for "adv" button, a "div" will render instead of
href-less "a" tag. This scenario isn't used, and would likely be a bug.
mks-h added 16 commits June 29, 2024 12:54
The ".card--has-actions" class is removed as it should always be used
at the same time as ".card--clickable". Uses of the ".card-action"
class are removed, as it is not defined or used in css.
There's some visual change, such as the pronounced part of the title is
bigger, and space between a multiline string is smaller (as it is a
single string now).
In DownloadOrchidBeta, replace manual card with the Card component.
@mks-h
Copy link
Member Author

mks-h commented Jun 29, 2024

I have refactored the Card component to a certain degree. There's no immediate gain from it, apart from previously mentioned use of h3 headings. Trying to improve it any further leads to more verbosity, so I'd like to stop here.

@mks-h mks-h marked this pull request as ready for review June 29, 2024 13:23
@mirkobrombin mirkobrombin merged commit 0edd428 into Vanilla-OS:v2 Jul 2, 2024
1 check passed
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