Skip to content

Commit 7b942ae

Browse files
authored
align tutorial modal styles (#630)
* add primary button styles * improve tutorial modal
1 parent c517e42 commit 7b942ae

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

apps/svelte.dev/src/lib/components/Modal.svelte

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,24 @@
7474
filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.1));
7575
z-index: 99999;
7676
}
77+
78+
.modal :global {
79+
h2 {
80+
font: var(--sk-font-ui-large);
81+
margin: 0 0 0.5em 0;
82+
}
83+
84+
p {
85+
font: var(--sk-font-ui-medium);
86+
}
87+
88+
button {
89+
display: block;
90+
padding: 1rem;
91+
width: 10rem;
92+
margin: 1em 0 0 0;
93+
line-height: 1;
94+
font: var(--sk-font-ui-small);
95+
}
96+
}
7797
</style>

apps/svelte.dev/src/routes/tutorial/[...slug]/Sidebar.svelte

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
enable copy-and-paste for the duration of this session
100100
</label>
101101

102-
<button on:click={() => (show_modal = false)}>OK</button>
102+
<button class="raised primary" on:click={() => (show_modal = false)}>OK</button>
103103
</div>
104104
</Modal>
105105
{/if}
@@ -153,30 +153,12 @@
153153
}
154154
155155
.modal-contents {
156-
h2 {
157-
font: var(--sk-font-ui-large);
158-
margin: 0 0 0.5em 0;
159-
}
160-
161-
p {
162-
font: var(--sk-font-ui-medium);
163-
}
164-
165156
label {
166157
user-select: none;
167158
font: var(--sk-font-ui-medium);
168-
}
169-
170-
button {
171-
display: block;
172-
background-color: var(--sk-theme-1);
173-
color: white;
174-
padding: 1rem;
175-
width: 10em;
176-
margin: 1em 0 0 0;
177-
border-radius: var(--sk-border-radius);
178-
line-height: 1;
179-
font: var(--sk-font-ui-small);
159+
display: flex;
160+
align-items: center;
161+
gap: 0.5rem;
180162
}
181163
}
182164

apps/svelte.dev/src/routes/tutorial/[...slug]/filetree/Filetree.svelte

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
<div class="modal-contents">
146146
<h2>This action is not allowed</h2>
147147
<p>{modal_text}</p>
148-
<button onclick={() => (modal_text = '')}>OK</button>
148+
<button class="raised primary" onclick={() => (modal_text = '')}>OK</button>
149149
</div>
150150
</Modal>
151151
{/if}
@@ -169,15 +169,4 @@
169169
.modal-contents p {
170170
white-space: pre-line;
171171
}
172-
173-
.modal-contents button {
174-
display: block;
175-
background: var(--sk-theme-1);
176-
color: white;
177-
padding: 1rem;
178-
width: 10em;
179-
margin: 1em 0 0 0;
180-
border-radius: var(--sk-border-radius);
181-
line-height: 1;
182-
}
183172
</style>

packages/site-kit/src/lib/styles/utils/buttons.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
border-color: var(--sk-raised-color);
55
border-width: var(--sk-raised-width);
66

7+
&.primary {
8+
--sk-raised-color: hsla(12, 93%, 60%) hsla(12, 93%, 35%) hsla(12, 93%, 35%) hsla(12, 93%, 60%);
9+
--sk-raised-hover-color: hsla(12, 93%, 70%) hsla(12, 93%, 30%) hsla(12, 93%, 30%)
10+
hsla(12, 93%, 70%);
11+
--sk-raised-active-color: hsla(12, 93%, 30%) hsla(12, 93%, 70%) hsla(12, 93%, 70%)
12+
hsla(12, 93%, 30%);
13+
background: var(--sk-theme-1);
14+
color: white;
15+
}
16+
717
&:hover {
818
border-color: var(--sk-raised-hover-color);
919
}

0 commit comments

Comments
 (0)