Skip to content

Commit ff69141

Browse files
committed
✨ Add table for CSS resets
1 parent fd80411 commit ff69141

File tree

4 files changed

+74
-8
lines changed

4 files changed

+74
-8
lines changed

scripts/utilityTypes.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
export const utilityTypes = `
2-
type ModalCallback = {
2+
export type ModalCallback = {
33
trigger: Element | null
44
modal: HTMLElement
55
}
66
7-
type Modal = {
7+
export type Modal = {
88
trigger: string
99
modal: string
1010
onOpen?: (args: ModalCallback) => unknown
1111
onClose?: (args: ModalCallback) => unknown
1212
}
1313
14-
type PopoverPosition = 'top'
14+
export type PopoverPosition = 'top'
1515
| 'top-start'
1616
| 'top-end'
1717
| 'left'
@@ -24,13 +24,13 @@ type PopoverPosition = 'top'
2424
| 'bottom-start'
2525
| 'bottom-end'
2626
27-
type PopoverCallback = {
27+
export type PopoverCallback = {
2828
trigger: HTMLElement
2929
popover: HTMLElement
3030
position: PopoverPosition | undefined
3131
}
3232
33-
type Popover = {
33+
export type Popover = {
3434
trigger: string
3535
popover: string
3636
position?: PopoverPosition
@@ -40,7 +40,7 @@ type Popover = {
4040
onClose?: (args: PopoverCallback) => unknown
4141
}
4242
43-
type Toast = {
43+
export type Toast = {
4444
element: string
4545
timeout?: number
4646
title?: string

src/pages/resets.astro

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,45 @@ import Card from '@components/Card/Card.astro'
4949
</figcaption>
5050
</figure>
5151
</div>
52+
53+
<h2 class="reset">Other ways to configure CSS</h2>
54+
55+
<p>You can use the following options in your <code>setup</code> mixin to further configure your CSS.</p>
56+
57+
<table>
58+
<thead>
59+
<tr>
60+
<th>Option</th>
61+
<th>Default value</th>
62+
<th>Purpose</th>
63+
</tr>
64+
</thead>
65+
<tbody>
66+
<tr>
67+
<td><code>includeResets</code></td>
68+
<td><code>true</code></td>
69+
<td>
70+
Include reset styles for native HTML elements.
71+
</td>
72+
</tr>
73+
<tr>
74+
<td><code>includeUtilities</code></td>
75+
<td><code>true</code></td>
76+
<td>
77+
Adds utility classes for CSS.
78+
</td>
79+
</tr>
80+
<tr>
81+
<td><code>includeTooltip</code></td>
82+
<td><code>true</code></td>
83+
<td>Adds global styles for tooltips.</td>
84+
</tr>
85+
<tr>
86+
<td><code>includeScrollbarStyles</code></td>
87+
<td><code>true</code></td>
88+
<td>Adds global styles for scrollbars.</td>
89+
</tr>
90+
</tbody>
91+
</table>
5292
</Card>
5393
</Layout>

src/scss/resets.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,30 @@
103103
@include border(0);
104104
@include background(primary-50);
105105
}
106+
107+
table {
108+
@include size('w100%');
109+
@include typography(left);
110+
111+
border-collapse: collapse;
112+
}
113+
114+
thead,
115+
tfoot {
116+
@include typography(bold);
117+
}
118+
119+
th,
120+
td {
121+
@include spacing(py-xs, px-sm);
122+
}
123+
124+
thead,
125+
tr {
126+
@include border(bottom, primary-50);
127+
128+
&:last-child {
129+
@include border(bottom, 0);
130+
}
131+
}
106132
}

src/static/Layout.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ const externalLinks = [
9191
margin-bottom: 100px;
9292
}
9393

94-
h1 {
94+
h1:not(.reset) {
9595
margin: 100px 0 10px;
9696
font-size: 48px;
9797
text-align: center;
9898
}
9999

100-
h2 {
100+
h2:not(.reset) {
101101
color: var(--w-color-primary-10);
102102
font-family: Regular;
103103
font-weight: 400;

0 commit comments

Comments
 (0)