-
Notifications
You must be signed in to change notification settings - Fork 71
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
But dang that button is 🔥 |
export let disabled = false; | ||
export let position: 'left' | 'right' = 'left'; | ||
export let href = ''; | ||
export let primaryActionDisabled = false; | ||
</script> | ||
|
||
<MenuContainer class={$$props.class}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
@@ -3,7 +3,7 @@ | |||
|
|||
import EventCategoryFilter from '$lib/components/event/event-category-filter.svelte'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
src/lib/components/workflow/filter-search/boolean-filter.svelte
Outdated
Show resolved
Hide resolved
Co-authored-by: Laura Whitaker <[email protected]>
@@ -21,7 +21,7 @@ const colors = { | |||
}, | |||
indigo: { | |||
50: '#eef2ff', | |||
100: '#e0e7ff', | |||
100: '#E0EAFF', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ternary feels weird.
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Docs
Any docs updates needed?