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(Alert): use CSS logical properties instead of physical values #1094

Merged
merged 5 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ const TemplateSticky = (args: Args) => html`
${args.type === 'default' ? html`<bq-icon name="star" slot="icon"></bq-icon>` : nothing} Title
<bq-button appearance="link" size="small"> Button </bq-button>
</bq-alert>
<main class="grid grid-cols-1 p-m">
<h1 class="mb-l">Dashboard</h1>
<div class="border h-80 w-full border-dashed border-stroke-primary bg-[--bq-ui--alt]"></div>
<main class="grid grid-cols-1 p-b-m p-i-m">
<h1 class="m-be-l">Dashboard</h1>
<div class="border border-dashed border-stroke-primary bg-[--bq-ui--alt] bs-80 is-full"></div>
</main>
`;

Expand Down
8 changes: 4 additions & 4 deletions packages/beeq/src/components/alert/bq-alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export class BqAlert {
{/* CLOSE BUTTON */}
{!this.disableClose && (
<bq-button
class="bq-alert__close absolute right-5 focus-visible:focus"
class="bq-alert__close absolute end-5 focus-visible:focus"
appearance="text"
size="small"
onClick={() => this.hide()}
Expand All @@ -259,7 +259,7 @@ export class BqAlert {
{/* ICON */}
<div
class={{
[`bq-alert__icon--${this.type} mr-s flex text-left align-top`]: true,
[`bq-alert__icon--${this.type} me-s flex text-left align-top`]: true,
'!hidden': this.hideIcon,
}}
part="icon-outline"
Expand All @@ -269,8 +269,8 @@ export class BqAlert {
</slot>
</div>
{/* MAIN */}
<div class="flex flex-col items-start gap-[var(--bq-alert--content-footer-gap)]" part="main">
<div class="flex flex-col gap-[var(--bq-alert--title-body-gap)]" part="content">
<div class="flex flex-col items-start gap-[--bq-alert--content-footer-gap]" part="main">
<div class="flex flex-col gap-[--bq-alert--title-body-gap]" part="content">
{/* TITLE */}
<div
class={{
Expand Down
6 changes: 3 additions & 3 deletions packages/beeq/src/components/alert/scss/bq-alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
}

:host(.is-sticky) {
@apply fixed inset-0 top-0 z-[var(--bq-alert--z-index)] w-full;
@apply fixed inset-0 z-[var(--bq-alert--z-index)] is-full inset-bs-0;

.bq-alert {
@apply items-center justify-center rounded-none;
}
}

.bq-alert {
@apply relative flex min-w-[var(--bq-alert--min-width)] p-[var(--bq-alert--padding)] transition-all;
@apply relative flex transition-all min-is-[--bq-alert--min-width] p-b-[--bq-alert--padding] p-i-[--bq-alert--padding];
@apply rounded-[var(--bq-alert--border-radius)] border-[length:--bq-alert--border-width];

border-style: var(--bq-alert--border-style);
Expand Down Expand Up @@ -80,5 +80,5 @@
* Tweak the close bq-button styles so it remain small without extra padding
*/
.bq-alert__close::part(button) {
@apply h-fit rounded-s border-0 p-0;
@apply rounded-s border-0 bs-fit p-b-0 p-i-0;
}
2 changes: 1 addition & 1 deletion packages/beeq/src/components/drawer/bq-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class BqDrawer {
<div class="flex" part="button-close">
<slot name="button-close">
<bq-button
class="[&::part(button)]:h-fit [&::part(button)]:rounded-s [&::part(button)]:border-0 [&::part(button)]:p-0"
class="[&::part(button)]:rounded-s [&::part(button)]:border-0 [&::part(button)]:bs-fit [&::part(button)]:p-b-0 [&::part(button)]:p-i-0"
appearance="text"
size="small"
slot="button-close"
Expand Down