Skip to content

Commit 1069f62

Browse files
committed
fix: send to codepen
1 parent fde6fbd commit 1069f62

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

src/ui/Panel.svelte

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,16 @@
191191
/>
192192
</div>
193193
<div class="operate">
194-
<button on:click={copyResult} disabled={strCss === ''} id="copy" class="btn"
194+
<button on:click={copyResult} disabled={strCss === ''} class="copy"
195195
>{btnCopyText}</button
196196
>
197-
<button on:click={preview} disabled={strCss === ''} class="btn"
198-
>Preview</button
199-
>
197+
<button on:click={preview} disabled={strCss === ''}>Preview</button>
200198
<form action="https://codepen.io/pen/define" method="POST" target="_blank">
201-
<input type="hidden" name="data" value={dataForCodepen} />
199+
<input type="hidden" name="data" value={JSON.stringify(dataForCodepen)} />
202200
<button
203201
disabled={strCss === ''}
204202
title="Send snippet to CodePen"
205-
type="submit"
206-
value=""
207-
class="btn">CodePen</button
203+
type="submit">CodePen</button
208204
>
209205
</form>
210206
</div>
@@ -297,9 +293,48 @@
297293
resize: none;
298294
overflow: auto;
299295
}
296+
button {
297+
position: relative;
298+
font-size: 12px;
299+
display: block;
300+
margin-right: 10px;
301+
margin: 2px;
302+
height: 24px;
303+
border: 1px solid rgba(0, 0, 0, 0.2);
304+
border-radius: 4px;
305+
padding: 0px 12px;
306+
font-weight: 500;
307+
color: #1a73e8;
308+
background-color: #fff;
309+
flex: none;
310+
white-space: nowrap;
311+
height: 28px;
312+
margin: 8px 16px 8px 0;
313+
}
300314
button[disabled] {
301315
filter: grayscale(1) opacity(0.5);
302316
}
317+
button:not([disabled]):hover {
318+
background-color: #f3f3f3;
319+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
320+
}
321+
button.plain {
322+
background: none;
323+
text-decoration: underline;
324+
cursor: pointer;
325+
padding: 0.3em 0.6em;
326+
border-radius: 4px;
327+
}
328+
329+
button.copy {
330+
background-color: #1a73e8;
331+
border: none;
332+
color: #fff;
333+
}
334+
button.copy:not([disabled]):hover {
335+
background-color: #3b86e8;
336+
}
337+
303338
/* ::selection {
304339
background: #cfe8fc;
305340
} */
@@ -323,41 +358,13 @@
323358
.pop p {
324359
margin: auto;
325360
}
326-
button.plain {
327-
background: none;
328-
text-decoration: underline;
329-
cursor: pointer;
330-
padding: 0.3em 0.6em;
331-
border-radius: 4px;
332-
}
361+
333362
.pop .info {
334363
padding-left: 10px;
335364
}
336365
.pop .info pre {
337366
white-space: break-spaces;
338367
}
339-
.btn {
340-
position: relative;
341-
font-size: 12px;
342-
display: block;
343-
margin-right: 10px;
344-
margin: 2px;
345-
height: 24px;
346-
border: 1px solid rgba(0, 0, 0, 0.2);
347-
border-radius: 4px;
348-
padding: 0px 12px;
349-
font-weight: 500;
350-
color: #1a73e8;
351-
background-color: #fff;
352-
flex: none;
353-
white-space: nowrap;
354-
height: 28px;
355-
margin: 8px 16px 8px 0;
356-
}
357-
.btn:not([disabled]):hover {
358-
background-color: #f3f3f3;
359-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
360-
}
361368
362369
form {
363370
font-size: 12px;
@@ -373,6 +380,7 @@
373380
margin-left: 10px;
374381
flex-wrap: wrap;
375382
}
383+
376384
.theme-dark {
377385
color: rgba(255, 255, 255, 0.87);
378386
background-color: #242424;
@@ -424,20 +432,12 @@
424432
.theme-dark .pop button.plain:not([disabled]):hover {
425433
color: #cccccc;
426434
}
427-
#copy {
428-
background-color: #1a73e8;
429-
border: none;
430-
color: #fff;
431-
}
432-
#copy:not([disabled]):hover {
433-
background-color: #3b86e8;
434-
}
435-
.theme-dark #copy {
435+
.theme-dark button.copy {
436436
background-color: #0e639c;
437437
border: none;
438438
color: #fff;
439439
}
440-
.theme-dark #copy:not([disabled]):hover {
440+
.theme-dark button.copy:not([disabled]):hover {
441441
background-color: #1177bb;
442442
}
443443
</style>

0 commit comments

Comments
 (0)