-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix(tab-title): tabs center when set to layout='center'
#7026
Changes from all commits
3d9bb3b
9b1f151
11758a0
18f63c0
92966a4
4664adb
d0b914d
7c36006
400201a
006dff3
704ff62
de47d0f
e2d3a7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,40 @@ | |
:host([layout="center"]) { | ||
@apply my-0 mx-5 text-center; | ||
flex-basis: theme("spacing.48"); | ||
margin: auto; | ||
.content { | ||
@apply m-auto; | ||
} | ||
} | ||
|
||
// center the text visually and not affected by the x button so as to avoid moving when on or off | ||
:host([layout="center"][closable]) { | ||
.content { | ||
padding-inline-start: 32px; //28px button width + 0.25rem padding | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can I get guidance on how to implement tokens here? Or is it something we could do as a follow-up like you said earlier @driskull? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Elijbet this is good for the release. Can you open an issue to address this by using our design tokens/tailwind for this padding? Ideally both the button width and padding should be tied to variables. |
||
} | ||
|
||
:host([layout="center"][bordered][closable][scale="s"]) { | ||
.content { | ||
padding-inline-start: 36px; //28px button width + 0.5rem padding | ||
} | ||
} | ||
|
||
:host([layout="center"][bordered][closable][scale="m"]) { | ||
.content { | ||
padding-inline-start: 40px; //28px button width + 0.75rem padding | ||
} | ||
} | ||
|
||
:host([layout="center"][closable][scale="l"]) { | ||
.content { | ||
padding-inline-start: 40px; //36px button width + .25 padding | ||
} | ||
} | ||
|
||
:host([layout="center"][closable][bordered][scale="l"]) { | ||
.content { | ||
padding-inline-start: 52px; //36px button width + 1rem padding | ||
} | ||
} | ||
|
||
:host([position="bottom"]) .container { | ||
|
@@ -192,9 +225,15 @@ | |
|
||
:host([closable]) .container, | ||
:host([bordered]) .container { | ||
border-block-end-style: unset; | ||
border-inline-start: 1px solid transparent; | ||
border-inline-end: 1px solid transparent; | ||
.close-button { | ||
margin-inline: 0; | ||
} | ||
} | ||
|
||
:host([closable]) .content { | ||
@apply h-full box-border border-b-color-transparent; | ||
} | ||
|
||
:host([closable][position="bottom"]) .container, | ||
|
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.
given that there's no difference between
margin: auto
and@apply m-auto
I'd recommend usingmargin: auto
it's more readableThere 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.
Since we're using tailwind for now, it makes sense to stick to tailwind classes if they are available, for consistency. This is what we've been doing so far. Also, overlapping uses of tailwind and regular css props might create oversight doubling use of both by accident.
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.
Agreed, lets keep tailwind for now for consistency. Hopefully we can remove tailwind in the future.