@sesamehr/react-design-system 2.0.0-beta.1 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/Data/Table/hooks/useDragToScroll/useDragToScroll.d.ts +12 -2
- package/dist/Display/Badge/Badge.d.ts +3 -2
- package/dist/Display/Badge/index.d.ts +10 -1
- package/dist/Display/ChatBubble/ChatBubble.d.ts +11 -0
- package/dist/Display/ChatBubble/ChatBubbleStatus/ChatBubbleStatus.d.ts +8 -0
- package/dist/Display/ChatBubble/ChatBubbleStatus/index.d.ts +10 -0
- package/dist/Display/ChatBubble/index.d.ts +13 -0
- package/dist/Display/Chip/Chip.d.ts +14 -4
- package/dist/Display/Chip/index.d.ts +14 -10
- package/dist/Forms/Field/Counter/Counter.d.ts +9 -0
- package/dist/Forms/Field/Counter/index.d.ts +13 -0
- package/dist/lib/cssModules.d.ts +13 -0
- package/dist/main.d.ts +3 -1
- package/dist/preflight.css +391 -0
- package/dist/react-design-system.css +1 -1
- package/dist/react-design-system.js +5450 -5236
- package/dist/react-design-system.umd.cjs +55 -45
- package/package.json +1 -1
- package/src/assets/styles/theme-v2.css +6 -6
- package/src/assets/styles/theme-v3.css +7 -4
- package/dist/Display/Tag/Tag.d.ts +0 -19
- package/dist/Display/Tag/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -18,6 +18,10 @@ Import the stylesheet once at your app entry:
|
|
|
18
18
|
import '@sesamehr/react-design-system/style.css';
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
That stylesheet paints this package's components and nothing else. It carries no
|
|
22
|
+
reset and no utility classes, so importing it cannot restyle the application
|
|
23
|
+
around it — see [What the stylesheet does not do](#what-the-stylesheet-does-not-do).
|
|
24
|
+
|
|
21
25
|
Every component is exported with the `Ox` prefix:
|
|
22
26
|
|
|
23
27
|
```tsx
|
|
@@ -64,6 +68,36 @@ from your own Tailwind setup:
|
|
|
64
68
|
@import '@sesamehr/react-design-system/assets/styles/mainTheme.css';
|
|
65
69
|
```
|
|
66
70
|
|
|
71
|
+
### What the stylesheet does not do
|
|
72
|
+
|
|
73
|
+
`style.css` contains this package's component rules and its tokens. It
|
|
74
|
+
deliberately does **not** contain:
|
|
75
|
+
|
|
76
|
+
- **Preflight**, or any other global reset. The components assume one — they are
|
|
77
|
+
written against `box-sizing: border-box`, `button { font: inherit }` and the
|
|
78
|
+
rest — but installing it is the application's call, not a library's. If your
|
|
79
|
+
app has Tailwind, you already have it. If it does not:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import '@sesamehr/react-design-system/preflight.css';
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **Utility classes.** No `.h-10`, no `.p-4`, no `.bg-brand`. Every component
|
|
86
|
+
carries its own `ox`-prefixed class and the declarations are compiled into it,
|
|
87
|
+
so nothing here can collide with the identically-named utilities your own
|
|
88
|
+
Tailwind build emits from your scale.
|
|
89
|
+
|
|
90
|
+
Component rules ship inside `@layer components`, which is where a Tailwind app
|
|
91
|
+
already sorts them: after `base`, before `utilities`. So a utility you pass in
|
|
92
|
+
wins — `<Button className="w-full">` is full width — without needing
|
|
93
|
+
`!important`.
|
|
94
|
+
|
|
95
|
+
Tokens are published under an `--ox-` prefix: override `--ox-color-brand-500`
|
|
96
|
+
to retheme, not `--color-brand-500`. Unprefixed, those are the names Tailwind
|
|
97
|
+
itself uses, and declaring them at `:root` would change what every `rounded-2xl`
|
|
98
|
+
in your application means.
|
|
99
|
+
|
|
100
|
+
|
|
67
101
|
## License
|
|
68
102
|
|
|
69
103
|
MIT © Sesame HR
|
|
@@ -4,6 +4,15 @@ export interface UseDragToScrollOptions {
|
|
|
4
4
|
enabled?: boolean | (() => boolean);
|
|
5
5
|
/** Cursor to show while dragging */
|
|
6
6
|
cursor?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Selector for elements that own their own drag, where panning must keep out.
|
|
9
|
+
*
|
|
10
|
+
* A pan and a row reorder are the same gesture, and this hook calls
|
|
11
|
+
* `preventDefault()` on every `mousedown` it sees — which is exactly what
|
|
12
|
+
* stops dnd-kit from ever starting. Bowing out over the grip lets the two
|
|
13
|
+
* share the table: the handle reorders, everywhere else pans.
|
|
14
|
+
*/
|
|
15
|
+
ignore?: string;
|
|
7
16
|
}
|
|
8
17
|
export interface UseDragToScrollReturn {
|
|
9
18
|
/** Whether the user is currently dragging to scroll */
|
|
@@ -13,7 +22,8 @@ export interface UseDragToScrollReturn {
|
|
|
13
22
|
* Hook for drag-to-scroll functionality.
|
|
14
23
|
* Allows horizontal scrolling by dragging with the mouse.
|
|
15
24
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
25
|
+
* Coexists with row drag & drop: panning keeps out of whatever `ignore`
|
|
26
|
+
* matches, which by default is the design system's drag grip. Both gestures can
|
|
27
|
+
* be live on the same table, so there is no need to turn one off.
|
|
18
28
|
*/
|
|
19
29
|
export declare function useDragToScroll(elementRef: RefObject<HTMLElement | null>, options?: UseDragToScrollOptions): UseDragToScrollReturn;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BadgeVariants } from './index.ts';
|
|
2
2
|
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
-
|
|
3
|
+
/** How big the counter is. `sm` is the bare dot and takes no content. */
|
|
4
|
+
size?: BadgeVariants['size'];
|
|
4
5
|
dataTestid: string;
|
|
5
6
|
}
|
|
6
|
-
/** Badge — mirrors `@sesame/orxata-core` Badge
|
|
7
|
+
/** Badge — mirrors `@sesame/orxata-core` Badge: a count, or a bare dot. */
|
|
7
8
|
export declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
export { Badge, type BadgeProps } from './Badge.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* A count, or a bare dot. Not a labelled pill.
|
|
5
|
+
*
|
|
6
|
+
* Figma's `Badges` set varies on one axis — size — and nothing else: `sm` is a
|
|
7
|
+
* 6px dot with no content, `md` a 16px circle and `lg` a 22px one, all of them
|
|
8
|
+
* `error` red with white text. The five colour variants this used to carry came
|
|
9
|
+
* from shadcn's Badge and were never in the design; a labelled pill is `Chip`
|
|
10
|
+
* or `StatusBadge`, both of which Figma does draw.
|
|
11
|
+
*/
|
|
3
12
|
export declare const badgeVariants: (props?: ({
|
|
4
|
-
|
|
13
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
14
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
15
|
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChatBubbleVariants } from './index.ts';
|
|
3
|
+
export interface ChatBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Who said it: the reader, or someone else */
|
|
5
|
+
author?: ChatBubbleVariants['author'];
|
|
6
|
+
/** The line under the message — the timestamp, and a receipt if there is one */
|
|
7
|
+
meta?: ReactNode;
|
|
8
|
+
dataTestid: string;
|
|
9
|
+
}
|
|
10
|
+
/** ChatBubble — mirrors `@sesame/orxata-core` ChatBubble. */
|
|
11
|
+
export declare const ChatBubble: import('react').ForwardRefExoticComponent<ChatBubbleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChatBubbleStatusVariants } from './index.ts';
|
|
2
|
+
export interface ChatBubbleStatusProps extends React.SVGAttributes<SVGSVGElement> {
|
|
3
|
+
/** How far along the message is */
|
|
4
|
+
status?: NonNullable<ChatBubbleStatusVariants['status']>;
|
|
5
|
+
dataTestid: string;
|
|
6
|
+
}
|
|
7
|
+
/** ChatBubbleStatus — mirrors `@sesame/orxata-core` ChatBubbleStatus. */
|
|
8
|
+
export declare const ChatBubbleStatus: import('react').ForwardRefExoticComponent<ChatBubbleStatusProps & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { ChatBubbleStatus, type ChatBubbleStatusProps, } from './ChatBubbleStatus.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* How far along a sent message is. Only the reader's own messages carry one —
|
|
5
|
+
* there is no receipt for what somebody else said.
|
|
6
|
+
*/
|
|
7
|
+
export declare const chatBubbleStatusVariants: (props?: ({
|
|
8
|
+
status?: "pending" | "sent" | "delivered" | "read" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
export type ChatBubbleStatusVariants = VariantProps<typeof chatBubbleStatusVariants>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { ChatBubble, type ChatBubbleProps } from './ChatBubble.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* Who said it, which is the only thing that varies.
|
|
5
|
+
*
|
|
6
|
+
* The design draws a `Hover` state too, and it holds exactly one thing: a
|
|
7
|
+
* circled chevron for the message's actions menu. That is out of scope here, so
|
|
8
|
+
* hover has nothing left to change and the component does not pretend it does.
|
|
9
|
+
*/
|
|
10
|
+
export declare const chatBubbleVariants: (props?: ({
|
|
11
|
+
author?: "other" | "user" | null | undefined;
|
|
12
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
|
+
export type ChatBubbleVariants = VariantProps<typeof chatBubbleVariants>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { ChipVariants } from './index.ts';
|
|
2
|
-
export interface ChipProps extends React.
|
|
3
|
-
/**
|
|
4
|
-
|
|
2
|
+
export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
3
|
+
/** How tall it is, and whether it holds a label or a single icon */
|
|
4
|
+
size?: ChipVariants['size'];
|
|
5
|
+
/** How its corners are cut */
|
|
6
|
+
shape?: ChipVariants['shape'];
|
|
7
|
+
/**
|
|
8
|
+
* Whether it is being dragged.
|
|
9
|
+
*
|
|
10
|
+
* Of the four states the design draws, this is the only one the browser
|
|
11
|
+
* cannot tell us about on its own: rest, hover and focus are `:hover` and
|
|
12
|
+
* `:focus-visible`, and there is no `:dragging`.
|
|
13
|
+
*/
|
|
14
|
+
dragged?: boolean;
|
|
5
15
|
dataTestid: string;
|
|
6
16
|
}
|
|
7
17
|
/** Chip — mirrors `@sesame/orxata-core` Chip. */
|
|
8
|
-
export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & import('react').RefAttributes<
|
|
18
|
+
export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,18 +2,22 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export { Chip } from './Chip.tsx';
|
|
3
3
|
export type { ChipProps } from './Chip.tsx';
|
|
4
4
|
/**
|
|
5
|
-
* A chip is a
|
|
6
|
-
*
|
|
7
|
-
* worked out. That is the line between
|
|
8
|
-
*
|
|
5
|
+
* A chip is a control the user acts on — a value they picked and can drop, a
|
|
6
|
+
* filter they can press. `Badge` is the system talking back: a status it
|
|
7
|
+
* assigned, a count it worked out, nothing to click. That is the line between
|
|
8
|
+
* them, and it is why this one is an outlined button and that one a solid fill.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Class names, not utilities: the declarations live in `Chip.module.css` behind
|
|
11
|
+
* `@apply`. See `Button/index.ts` for the full reasoning.
|
|
12
|
+
*
|
|
13
|
+
* The two axes are the design's own, with one renaming. Its `Form` is `shape`
|
|
14
|
+
* here because `form` on a `<button>` is a native attribute that associates the
|
|
15
|
+
* button with a form, and a prop of that name would quietly eat it. Its
|
|
16
|
+
* `Circle` is this `rounded`: an icon chip's box is already square, so the
|
|
17
|
+
* circle is the same radius as a text chip's pill and needs no value of its own.
|
|
15
18
|
*/
|
|
16
19
|
export declare const chipVariants: (props?: ({
|
|
17
|
-
|
|
20
|
+
size?: "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
21
|
+
shape?: "square" | "rounded" | null | undefined;
|
|
18
22
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
19
23
|
export type ChipVariants = VariantProps<typeof chipVariants>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CounterProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
2
|
+
/** How much the field holds now */
|
|
3
|
+
value: number;
|
|
4
|
+
/** How much it is allowed to hold */
|
|
5
|
+
max: number;
|
|
6
|
+
dataTestid: string;
|
|
7
|
+
}
|
|
8
|
+
/** Counter — mirrors `@sesame/orxata-core` Counter. */
|
|
9
|
+
export declare const Counter: import('react').ForwardRefExoticComponent<CounterProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { Counter, type CounterProps } from './Counter.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the field is still within its limit.
|
|
5
|
+
*
|
|
6
|
+
* Not a prop: the component has `value` and `max`, so asking a caller to also
|
|
7
|
+
* tell it which state that adds up to invites the two to disagree — a red
|
|
8
|
+
* counter reading 20/100, or a grey one reading 150/100.
|
|
9
|
+
*/
|
|
10
|
+
export declare const counterVariants: (props?: ({
|
|
11
|
+
state?: "over" | "within" | null | undefined;
|
|
12
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
|
+
export type CounterVariants = VariantProps<typeof counterVariants>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps the class names a `cva()` returns through a CSS module's hashed names.
|
|
3
|
+
*
|
|
4
|
+
* The variant objects are copied verbatim between the two packages —
|
|
5
|
+
* `parity-variants` compares them as source text — so they have to hold the
|
|
6
|
+
* same literal strings on both sides: `'ox-button--default'`, not a
|
|
7
|
+
* `styles.oxButtonDefault` lookup that only exists here. The lookup happens
|
|
8
|
+
* afterwards, which is what this is.
|
|
9
|
+
*
|
|
10
|
+
* A name the module does not define passes through untouched, so a caller's own
|
|
11
|
+
* class survives being handed to it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const moduleClasses: (styles: Record<string, string>, names: string | undefined) => string;
|
package/dist/main.d.ts
CHANGED
|
@@ -18,7 +18,8 @@ export { Badge as OxBadge, badgeVariants, type BadgeVariants, } from './Display/
|
|
|
18
18
|
export { CalendarDate as OxCalendarDate, calendarDateVariants, type CalendarDateVariants, } from './Display/CalendarDate/index.ts';
|
|
19
19
|
export { NumberFlow as OxNumberFlow, resolveNumberFlowPreset, NUMBER_FLOW_PRESETS, type NumberFlowConfig, type NumberFlowPreset, } from './Display/NumberFlow/index.ts';
|
|
20
20
|
export { PaymentCard as OxPaymentCard, paymentCardVariants, type PaymentCardVariants, type BadgeType, type CardData, } from './Display/PaymentCard/index.ts';
|
|
21
|
-
export {
|
|
21
|
+
export { ChatBubble as OxChatBubble, chatBubbleVariants, type ChatBubbleVariants, } from './Display/ChatBubble/index.ts';
|
|
22
|
+
export { ChatBubbleStatus as OxChatBubbleStatus, chatBubbleStatusVariants, type ChatBubbleStatusVariants, } from './Display/ChatBubble/ChatBubbleStatus/index.ts';
|
|
22
23
|
export { Chip as OxChip, chipVariants, type ChipVariants, } from './Display/Chip/index.ts';
|
|
23
24
|
export { PointMarker as OxPointMarker, pointMarkerVariants, type PointMarkerVariants, } from './Display/PointMarker/index.ts';
|
|
24
25
|
export { StatusBadge as OxStatusBadge, statusBadgeVariants, indicatorVariants, type StatusBadgeVariants, } from './Feedback/StatusBadge/index.ts';
|
|
@@ -32,6 +33,7 @@ export { Accordion as OxAccordion, AccordionItem as OxAccordionItem, AccordionTr
|
|
|
32
33
|
export { ToggleTabs as OxToggleTabs, ToggleTabsList as OxToggleTabsList, ToggleTabsTrigger as OxToggleTabsTrigger, ToggleTabsContent as OxToggleTabsContent, } from './Navigation/ToggleTabs/index.ts';
|
|
33
34
|
export { PageControl as OxPageControl, pageControlDots, PAGE_CONTROL_WINDOW, type PageControlDot, type PageControlDotSize, } from './Navigation/PageControl/index.ts';
|
|
34
35
|
export { Breadcrumb as OxBreadcrumb, BreadcrumbList as OxBreadcrumbList, BreadcrumbItem as OxBreadcrumbItem, BreadcrumbLink as OxBreadcrumbLink, BreadcrumbPage as OxBreadcrumbPage, BreadcrumbSeparator as OxBreadcrumbSeparator, BreadcrumbEllipsis as OxBreadcrumbEllipsis, } from './Navigation/Breadcrumb/index.ts';
|
|
36
|
+
export { Counter as OxCounter, counterVariants, type CounterVariants, } from './Forms/Field/Counter/index.ts';
|
|
35
37
|
export { FieldGroup as OxFieldGroup, FieldLabel as OxFieldLabel, FieldMessage as OxFieldMessage, type FieldGroupProps, } from './Forms/Field/index.ts';
|
|
36
38
|
export { InputGroup as OxInputGroup, InputText as OxInputText, InputNumber as OxInputNumber, InputNumberContent as OxInputNumberContent, InputNumberDecrement as OxInputNumberDecrement, InputNumberIncrement as OxInputNumberIncrement, InputNumberInput as OxInputNumberInput, InputPassword as OxInputPassword, InputPasswordInput as OxInputPasswordInput, InputPasswordToggle as OxInputPasswordToggle, useInputPassword, InputOtp as OxInputOtp, InputOtpGroup as OxInputOtpGroup, InputOtpSlot as OxInputOtpSlot, InputOtpSeparator as OxInputOtpSeparator, useInputOtp, Combobox as OxCombobox, ComboboxInput as OxComboboxInput, ComboboxChipsInput as OxComboboxChipsInput, ComboboxContent as OxComboboxContent, ComboboxItem as OxComboboxItem, ComboboxEmpty as OxComboboxEmpty, ComboboxGroup as OxComboboxGroup, ComboboxSeparator as OxComboboxSeparator, Select as OxSelect, SelectTrigger as OxSelectTrigger, SelectContent as OxSelectContent, SelectItem as OxSelectItem, SelectGroup as OxSelectGroup, SelectSeparator as OxSelectSeparator, Switch as OxSwitch, Checkbox as OxCheckbox, RadioButton as OxRadioButton, RadioGroup as OxRadioGroup, ToggleGroup as OxToggleGroup, ToggleLabel as OxToggleLabel, ToggleDescription as OxToggleDescription, SWITCH_SIZES, type InputNumberProps, type InputPasswordProps, type InputPasswordContext, type InputOtpProps, type InputOtpSlotProps, type InputOtpContext, type ComboboxProps, type SelectProps, type RadioGroupProps, type ToggleGroupProps, type ToggleLabelProps, type ToggleDescriptionProps, } from './Forms/Inputs/index.ts';
|
|
37
39
|
export { Table as OxTable, TableHead as OxTableHead, TableBody as OxTableBody, TableRow as OxTableRow, TableCell as OxTableCell, TableHeaderCell as OxTableHeaderCell, TableSelectCell as OxTableSelectCell, TableDragCell as OxTableDragCell, TableBulkHeader as OxTableBulkHeader, TablePagination as OxTablePagination, TableEmpty as OxTableEmpty, TableAvatar as OxTableAvatar, TableRowExpanded as OxTableRowExpanded, TableExpandCell as OxTableExpandCell, TableColumnVisibility as OxTableColumnVisibility, useTable, useTableSelection, useTableSorting, useTablePagination, useTableDetailRow, useTablePinning, useTableColumns, useScrollShadow, useDragToScroll, useFixedColumns, } from './Data/Table/index.ts';
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
@layer base{
|
|
2
|
+
/*
|
|
3
|
+
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
|
4
|
+
2. Remove default margins and padding
|
|
5
|
+
3. Reset all borders.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
*,
|
|
9
|
+
::after,
|
|
10
|
+
::before,
|
|
11
|
+
::backdrop,
|
|
12
|
+
::file-selector-button {
|
|
13
|
+
box-sizing: border-box; /* 1 */
|
|
14
|
+
margin: 0; /* 2 */
|
|
15
|
+
padding: 0; /* 2 */
|
|
16
|
+
border: 0 solid; /* 3 */
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
1. Use a consistent sensible line-height in all browsers.
|
|
21
|
+
2. Prevent adjustments of font size after orientation changes in iOS.
|
|
22
|
+
3. Use a more readable tab size.
|
|
23
|
+
4. Use the user's configured `sans` font-family by default.
|
|
24
|
+
5. Use the user's configured `sans` font-feature-settings by default.
|
|
25
|
+
6. Use the user's configured `sans` font-variation-settings by default.
|
|
26
|
+
7. Disable tap highlights on iOS.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
html,
|
|
30
|
+
:host {
|
|
31
|
+
line-height: 1.5; /* 1 */
|
|
32
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
33
|
+
tab-size: 4; /* 3 */
|
|
34
|
+
font-family: var(--ox-default-font-family, ui-sans-serif,
|
|
35
|
+
system-ui,
|
|
36
|
+
sans-serif,
|
|
37
|
+
'Apple Color Emoji',
|
|
38
|
+
'Segoe UI Emoji',
|
|
39
|
+
'Segoe UI Symbol',
|
|
40
|
+
'Noto Color Emoji'
|
|
41
|
+
); /* 4 */
|
|
42
|
+
font-feature-settings: var(--ox-default-font-feature-settings, normal); /* 5 */
|
|
43
|
+
font-variation-settings: var(--ox-default-font-variation-settings, normal); /* 6 */
|
|
44
|
+
-webkit-tap-highlight-color: transparent; /* 7 */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
1. Add the correct height in Firefox.
|
|
49
|
+
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
|
50
|
+
3. Reset the default border style to a 1px solid border.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
hr {
|
|
54
|
+
height: 0; /* 1 */
|
|
55
|
+
color: inherit; /* 2 */
|
|
56
|
+
border-top-width: 1px; /* 3 */
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
Add the correct text decoration in Chrome, Edge, and Safari.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
abbr:where([title]) {
|
|
64
|
+
-webkit-text-decoration: underline dotted;
|
|
65
|
+
text-decoration: underline dotted;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
Remove the default font size and weight for headings.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
h1,
|
|
73
|
+
h2,
|
|
74
|
+
h3,
|
|
75
|
+
h4,
|
|
76
|
+
h5,
|
|
77
|
+
h6 {
|
|
78
|
+
font-size: inherit;
|
|
79
|
+
font-weight: inherit;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Reset links to optimize for opt-in styling instead of opt-out.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
a {
|
|
87
|
+
color: inherit;
|
|
88
|
+
-webkit-text-decoration: inherit;
|
|
89
|
+
text-decoration: inherit;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Add the correct font weight in Edge and Safari.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
b,
|
|
97
|
+
strong {
|
|
98
|
+
font-weight: bolder;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
1. Use the user's configured `mono` font-family by default.
|
|
103
|
+
2. Use the user's configured `mono` font-feature-settings by default.
|
|
104
|
+
3. Use the user's configured `mono` font-variation-settings by default.
|
|
105
|
+
4. Correct the odd `em` font sizing in all browsers.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
code,
|
|
109
|
+
kbd,
|
|
110
|
+
samp,
|
|
111
|
+
pre {
|
|
112
|
+
font-family: var(--ox-default-mono-font-family, ui-monospace,
|
|
113
|
+
SFMono-Regular,
|
|
114
|
+
Menlo,
|
|
115
|
+
Monaco,
|
|
116
|
+
Consolas,
|
|
117
|
+
'Liberation Mono',
|
|
118
|
+
'Courier New',
|
|
119
|
+
monospace
|
|
120
|
+
); /* 1 */
|
|
121
|
+
font-feature-settings: var(--ox-default-mono-font-feature-settings, normal); /* 2 */
|
|
122
|
+
font-variation-settings: var(--ox-default-mono-font-variation-settings, normal); /* 3 */
|
|
123
|
+
font-size: 1em; /* 4 */
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
Add the correct font size in all browsers.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
small {
|
|
131
|
+
font-size: 80%;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
sub,
|
|
139
|
+
sup {
|
|
140
|
+
font-size: 75%;
|
|
141
|
+
line-height: 0;
|
|
142
|
+
position: relative;
|
|
143
|
+
vertical-align: baseline;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
sub {
|
|
147
|
+
bottom: -0.25em;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
sup {
|
|
151
|
+
top: -0.5em;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
|
156
|
+
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
|
157
|
+
3. Remove gaps between table borders by default.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
table {
|
|
161
|
+
text-indent: 0; /* 1 */
|
|
162
|
+
border-color: inherit; /* 2 */
|
|
163
|
+
border-collapse: collapse; /* 3 */
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/*
|
|
167
|
+
Use the modern Firefox focus style for all focusable elements.
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
:-moz-focusring {
|
|
171
|
+
outline: auto;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/*
|
|
175
|
+
Add the correct vertical alignment in Chrome and Firefox.
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
progress {
|
|
179
|
+
vertical-align: baseline;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/*
|
|
183
|
+
Add the correct display in Chrome and Safari.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
summary {
|
|
187
|
+
display: list-item;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
Make lists unstyled by default.
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
ol,
|
|
195
|
+
ul,
|
|
196
|
+
menu {
|
|
197
|
+
list-style: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
|
202
|
+
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
|
203
|
+
This can trigger a poorly considered lint error in some tools but is included by design.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
img,
|
|
207
|
+
svg,
|
|
208
|
+
video,
|
|
209
|
+
canvas,
|
|
210
|
+
audio,
|
|
211
|
+
iframe,
|
|
212
|
+
embed,
|
|
213
|
+
object {
|
|
214
|
+
display: block; /* 1 */
|
|
215
|
+
vertical-align: middle; /* 2 */
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/*
|
|
219
|
+
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
img,
|
|
223
|
+
video {
|
|
224
|
+
max-width: 100%;
|
|
225
|
+
height: auto;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/*
|
|
229
|
+
1. Inherit font styles in all browsers.
|
|
230
|
+
2. Remove border radius in all browsers.
|
|
231
|
+
3. Remove background color in all browsers.
|
|
232
|
+
4. Ensure consistent opacity for disabled states in all browsers.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
button,
|
|
236
|
+
input,
|
|
237
|
+
select,
|
|
238
|
+
optgroup,
|
|
239
|
+
textarea,
|
|
240
|
+
::file-selector-button {
|
|
241
|
+
font: inherit; /* 1 */
|
|
242
|
+
font-feature-settings: inherit; /* 1 */
|
|
243
|
+
font-variation-settings: inherit; /* 1 */
|
|
244
|
+
letter-spacing: inherit; /* 1 */
|
|
245
|
+
color: inherit; /* 1 */
|
|
246
|
+
border-radius: 0; /* 2 */
|
|
247
|
+
background-color: transparent; /* 3 */
|
|
248
|
+
opacity: 1; /* 4 */
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/*
|
|
252
|
+
Restore default font weight.
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
:where(select:is([multiple], [size])) optgroup {
|
|
256
|
+
font-weight: bolder;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/*
|
|
260
|
+
Restore indentation.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
:where(select:is([multiple], [size])) optgroup option {
|
|
264
|
+
padding-inline-start: 20px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/*
|
|
268
|
+
Restore space after button.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
::file-selector-button {
|
|
272
|
+
margin-inline-end: 4px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/*
|
|
276
|
+
Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
::placeholder {
|
|
280
|
+
opacity: 1;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/*
|
|
284
|
+
Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not
|
|
285
|
+
crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or
|
|
289
|
+
(contain-intrinsic-size: 1px) /* Safari 17+ */ {
|
|
290
|
+
::placeholder {
|
|
291
|
+
color: color-mix(in oklab, currentcolor 50%, transparent);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/*
|
|
296
|
+
Prevent resizing textareas horizontally by default.
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
textarea {
|
|
300
|
+
resize: vertical;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/*
|
|
304
|
+
Remove the inner padding in Chrome and Safari on macOS.
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
::-webkit-search-decoration {
|
|
308
|
+
-webkit-appearance: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/*
|
|
312
|
+
1. Ensure date/time inputs have the same height when empty in iOS Safari.
|
|
313
|
+
2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
|
|
314
|
+
*/
|
|
315
|
+
|
|
316
|
+
::-webkit-date-and-time-value {
|
|
317
|
+
min-height: 1lh; /* 1 */
|
|
318
|
+
text-align: inherit; /* 2 */
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/*
|
|
322
|
+
Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.
|
|
323
|
+
*/
|
|
324
|
+
|
|
325
|
+
::-webkit-datetime-edit {
|
|
326
|
+
display: inline-flex;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/*
|
|
330
|
+
Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
|
|
331
|
+
*/
|
|
332
|
+
|
|
333
|
+
::-webkit-datetime-edit-fields-wrapper {
|
|
334
|
+
padding: 0;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
::-webkit-datetime-edit,
|
|
338
|
+
::-webkit-datetime-edit-year-field,
|
|
339
|
+
::-webkit-datetime-edit-month-field,
|
|
340
|
+
::-webkit-datetime-edit-day-field,
|
|
341
|
+
::-webkit-datetime-edit-hour-field,
|
|
342
|
+
::-webkit-datetime-edit-minute-field,
|
|
343
|
+
::-webkit-datetime-edit-second-field,
|
|
344
|
+
::-webkit-datetime-edit-millisecond-field,
|
|
345
|
+
::-webkit-datetime-edit-meridiem-field {
|
|
346
|
+
padding-block: 0;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/*
|
|
350
|
+
Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)
|
|
351
|
+
*/
|
|
352
|
+
|
|
353
|
+
::-webkit-calendar-picker-indicator {
|
|
354
|
+
line-height: 1;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/*
|
|
358
|
+
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
:-moz-ui-invalid {
|
|
362
|
+
box-shadow: none;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/*
|
|
366
|
+
Correct the inability to style the border radius in iOS Safari.
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
button,
|
|
370
|
+
input:where([type='button'], [type='reset'], [type='submit']),
|
|
371
|
+
::file-selector-button {
|
|
372
|
+
appearance: button;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/*
|
|
376
|
+
Correct the cursor style of increment and decrement buttons in Safari.
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
::-webkit-inner-spin-button,
|
|
380
|
+
::-webkit-outer-spin-button {
|
|
381
|
+
height: auto;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/*
|
|
385
|
+
Make elements with the HTML hidden attribute stay hidden by default.
|
|
386
|
+
*/
|
|
387
|
+
|
|
388
|
+
[hidden]:where(:not([hidden='until-found'])) {
|
|
389
|
+
display: none !important;
|
|
390
|
+
}
|
|
391
|
+
}
|