Skip to content

Commit

Permalink
design feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sirineJ committed Mar 11, 2025
1 parent 1ca633c commit 6727781
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.base {
position: relative;
background-color: var(--cui-bg-normal);
}

.picker {
position: sticky;
top: 0;
z-index: 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
AccessibilityError,
isSufficientlyLabelled,
} from '../../util/errors.js';
import { clsx } from '../../styles/clsx.js';

import {
PlanPicker,
Expand All @@ -31,6 +32,7 @@ import {
PlanTable,
type PlanTableProps,
} from './components/PlanTable/PlanTable.js';
import classes from './ComparisonTable.module.css';

export interface ComparisonTableProps
extends Omit<PlanTableProps, 'activePlans' | 'isCollapsed'>,
Expand All @@ -48,6 +50,7 @@ export const ComparisonTable = forwardRef<
showAllFeaturesLabel,
selectFirstPlanLabel,
selectSecondPlanLabel,
className,
...props
},
ref,
Expand Down Expand Up @@ -95,9 +98,10 @@ export const ComparisonTable = forwardRef<
}, []);

return (
<div {...props}>
<div className={clsx(classes.base, className)} {...props}>
{isMobile && plans.length >= 3 && (
<PlanPicker
className={classes.picker}
plans={planOptions}
selectedPlans={activePlans}
onPlanSelect={onPlanSelect}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
gap: var(--cui-spacings-kilo);
justify-content: center;
width: 100%;
margin-bottom: var(--cui-spacings-giga);
padding-bottom: var(--cui-spacings-giga);
background-color: var(--cui-bg-normal);
}

@media (max-width: 479px) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.base {
position: relative;
width: 100%;
border-collapse: collapse;
border-spacing: 0;
border-collapse: separate;
}

.wrapper {
Expand All @@ -10,27 +10,27 @@
}

.offers {
th:last-child > div {
border-right: none;
th:first-child > div {
border-left: none;
}
}

.base thead th {
position: sticky;
top: 0;
z-index: 1;
padding-top: var(--cui-spacings-giga);
background-color: var(--cui-bg-normal);
}

.section {
position: sticky;
top: 0;
z-index: 1;
padding: var(--cui-spacings-mega) 0;
padding: var(--cui-spacings-giga) 0 var(--cui-spacings-mega);
text-align: start;
background-color: var(--cui-bg-normal);
box-shadow: inset 0 calc(-1 * var(--cui-border-width-kilo)) 0 0
var(--cui-border-strong);
border-bottom: var(--cui-border-width-kilo) solid var(--cui-border-strong);
}

.expand {
Expand All @@ -40,20 +40,23 @@
left: 0;
z-index: 1;
display: flex;
align-items: flex-end;
justify-content: center;
width: 100%;
min-height: 64px;
min-height: 96px;
content: "";
background: linear-gradient(
color-mix(in sRGB, var(--cui-bg-normal) 0%, transparent),
color-mix(in sRGB, var(--cui-bg-normal) 73.5%, transparent),
color-mix(in sRGB, var(--cui-bg-normal) 90%, transparent),
color-mix(in sRGB, var(--cui-bg-normal) 100%, transparent)
);
}

@media (max-width: 767px) {
.base th {
.base thead th {
top: 72px;
width: 30%;
padding-top: 0;
}

.base th:first-child {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const PlanTable = forwardRef<HTMLTableElement, PlanTableProps>(
return (
<div className={classes.wrapper}>
<table
style={{ position: 'relative' }}
className={classes.base}
ref={applyMultipleRefs(ref, tableRef)}
{...props}
Expand All @@ -150,8 +149,9 @@ export const PlanTable = forwardRef<HTMLTableElement, PlanTableProps>(
scope="rowgroup"
headers="features"
colSpan={plans.length + 1}
/* account for sticky plan selector on mobile */
style={{
top: `${headerHeight}px`,
top: `${(isMobile ? 72 : 0) + headerHeight}px`,
}}
>
<SectionTitleElement size="m" weight="semibold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
justify-content: center;
min-height: 96px;
padding: 0 var(--cui-spacings-kilo);
border-right: 1px solid var(--cui-border-subtle);
border-left: 1px solid var(--cui-border-subtle);
}

.wrapper {
padding: 0;
vertical-align: bottom;
}

Expand Down

0 comments on commit 6727781

Please sign in to comment.