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

DT-1248 - consistent link styles #1589

Merged
merged 42 commits into from
Aug 31, 2023
Merged

DT-1248 - consistent link styles #1589

merged 42 commits into from
Aug 31, 2023

Conversation

rossedfort
Copy link
Contributor

@rossedfort rossedfort commented Aug 24, 2023

Description & motivation 💭

Use <Link /> component wherever possible and adjust styles to match new figma designs.

Also refactor button to use CVA

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@rossedfort rossedfort requested a review from a team as a code owner August 24, 2023 20:24
@rossedfort rossedfort requested review from stevekinney and removed request for a team August 24, 2023 20:24
@vercel
Copy link

vercel bot commented Aug 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
holocene ⬜️ Ignored (Inspect) Visit Preview Aug 31, 2023 6:04pm

@Alex-Tideman
Copy link
Contributor

Alex-Tideman commented Aug 29, 2023

I think this button is a little too tall now, makes wonky spacing in the event history table. Or just make it items-center

Screen Shot 2023-08-29 at 3 27 04 PM Screen Shot 2023-08-29 at 3 28 42 PM

@Alex-Tideman
Copy link
Contributor

But dang that button is 🔥

src/lib/components/banner/banner.svelte Show resolved Hide resolved
src/lib/components/schedule/schedule-form-view.svelte Outdated Show resolved Hide resolved
src/lib/holocene/combobox/combobox.svelte Outdated Show resolved Hide resolved
src/lib/holocene/scroll-to-top.svelte Show resolved Hide resolved
export let disabled = false;
export let position: 'left' | 'right' = 'left';
export let href = '';
export let primaryActionDisabled = false;
</script>

<MenuContainer class={$$props.class}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we want to do something with z-index for the border on hover for these buttons

Screenshot 2023-08-29 at 3 50 14 PM
Screenshot 2023-08-29 at 3 50 34 PM

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'll ask Ash about this, I'm not sure what the expected behavior here is.

src/lib/holocene/button.svelte Show resolved Hide resolved
@@ -3,7 +3,7 @@

import EventCategoryFilter from '$lib/components/event/event-category-filter.svelte';
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the links in the expanded row could use centering

Screenshot 2023-08-29 at 3 53 44 PM Screenshot 2023-08-29 at 3 52 47 PM

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 think this is the same issue that Tideman commented on, should be fixed 👍

@@ -36,15 +36,15 @@
<th class="w-44"><EventCategoryFilter {compact} /></th>
<th class="w-auto xl:w-80">
<div class="flex w-full justify-end">
<button
class="relative flex w-28 items-center justify-end rounded sm:justify-between"
<Button
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want Button styling for any of the filters (e.g. Date & Time) in the header too?

Screenshot 2023-08-29 at 4 42 39 PM
Screenshot 2023-08-29 at 4 42 49 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think we need to sync up with Ash on the expected behavior here. The first 2 column headers are dropdown menus, which don't change background on hover, but the last column is a primary button with no dropdown.

@@ -21,7 +21,7 @@ const colors = {
},
indigo: {
50: '#eef2ff',
100: '#e0e7ff',
100: '#E0EAFF',
Copy link
Member

Choose a reason for hiding this comment

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

I am not going to block on this, but the inconsistency between capital and lower case makes me sad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair, I just copied the values from Figma, and figured we will be revisiting this file once Design finalizes our color palette.

@@ -24,9 +25,9 @@
class={`relative block text-center leading-10 ${severity}`}
{...$$restProps}
>
<a href={link} target="_blank" rel="noreferrer">
<Link href={link} newTab>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe external as the prop? I hate the camel case props that don't jive with the rest of HTML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I agree, although newTab was already the name of the prop in <Link /> so I didn't change it. Can make a follow up PR for that.

{id}
labelHidden
icon={icon ? 'search' : null}
Copy link
Member

Choose a reason for hiding this comment

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

This ternary feels weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

icon is a boolean prop that controls whether the magnifying glass icon displays in the input. icon={icon && 'search'} won't do, because then false would be passed to icon on <Input /> which is not valid. Could change null to undefined or '' but other than that I'm not sure how to make this better.

@@ -23,7 +23,7 @@
</script>

<MenuContainer>
<MenuButton id="boolean-filter" controls="boolean-filter-menu">
<MenuButton unroundLeft class="!border-l-0" id="boolean-filter" controls="boolean-filter-menu">
Copy link
Member

Choose a reason for hiding this comment

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

What's going on with the important?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default our inputs, buttons, menu buttons, etc. have borders and border radius, however there are instances where they are combined with other elements, and we want to remove that border and border-radius. I don't like the pattern of overriding default component styles by adding a css class, I would rather it be controlled by a prop so as to maintain visual consistency. That's exactly why I went with this approach for <Button />, I just haven't done it for <MenuButton />.

I'm not sure if important is necessary here though, we may just be able to pass the regular border-l-0 tailwind class, @laurakwhit did you happen to test that out?

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to use the group or peer classes in Tailwind.

Copy link
Member

Choose a reason for hiding this comment

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

For example, it looks like we know this is the first of its kind the group. Our styling could have affordances for this without us needed to specify it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if important is necessary here though, we may just be able to pass the regular border-l-0 tailwind class, @laurakwhit did you happen to test that out?

I did not. I just pulled that from somewhere similar.. Maybe ConditonalMenu?

variant="search"
unroundLeft
variant="secondary"
borderRadiusModifier="square-left"
Copy link
Member

Choose a reason for hiding this comment

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

This prop feels forced. Why can't we just pass a class?

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 think a prop is better so that as much of the css that affects how a component looks is in one place, i.e. the component itself. IMO adding a class to a component should be a last resort and only happen in extreme one-off cases, which we should probably try to avoid.

Copy link
Member

Choose a reason for hiding this comment

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

To the core problem, why would we need to manually pass this prop or class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because some of our interfaces make use of core components, like dropdown menu, button, input, etc. but need to be tweaked slightly for display with other components. I've yet to come up with a better way to solve this apart from making whole new sets of components that have square and/or borderless left or right edges, but it's on my back burner for sure.

Screen.Recording.2023-08-31.at.12.05.48.PM.mov
Screen.Recording.2023-08-31.at.12.07.04.PM.mov

@rossedfort rossedfort merged commit dd4389f into main Aug 31, 2023
10 checks passed
@rossedfort rossedfort deleted the DT-1248-link-hover-styles branch August 31, 2023 18:19
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.

4 participants