Fix HTML and CSS order and format CSS.

pull/6213/head
Babak F 5 years ago
parent b8810b8224
commit 538e07dee9

@ -1,5 +1,7 @@
<style>
strong { color: blue; }
</style>
<strong>Blue thing</strong>
<strong>blue thing</strong>
<style>
strong {
color: blue;
}
</style>

@ -1,5 +1,7 @@
<style>
strong { color: green; }
</style>
<strong>Green thing</strong>
<strong>green thing</strong>
<style>
strong {
color: green;
}
</style>

@ -1,5 +1,7 @@
<style>
strong { color: red; }
</style>
<strong>Red thing</strong>
<strong>red thing</strong>
<style>
strong {
color: red;
}
</style>

@ -1,5 +1,7 @@
<style>
strong { color: blue; }
</style>
<strong>Blue thing</strong>
<strong>blue thing</strong>
<style>
strong {
color: blue;
}
</style>

@ -1,5 +1,7 @@
<style>
strong { color: green; }
</style>
<strong>Green thing</strong>
<strong>green thing</strong>
<style>
strong {
color: green;
}
</style>

@ -1,5 +1,7 @@
<style>
strong { color: red; }
</style>
<strong>Red thing</strong>
<strong>red thing</strong>
<style>
strong {
color: red;
}
</style>

@ -8,6 +8,17 @@
}
</script>
<svelte:window/>
<div style="text-align: center">
{#if key}
<kbd>{key === ' ' ? 'Space' : key}</kbd>
<p>{keyCode}</p>
{:else}
<p>Focus this window and press any key</p>
{/if}
</div>
<style>
div {
display: flex;
@ -22,21 +33,10 @@
border-radius: 4px;
font-size: 6em;
padding: 0.2em 0.5em;
border-top: 5px solid rgba(255,255,255,0.5);
border-left: 5px solid rgba(255,255,255,0.5);
border-right: 5px solid rgba(0,0,0,0.2);
border-bottom: 5px solid rgba(0,0,0,0.2);
border-top: 5px solid rgba(255, 255, 255, 0.5);
border-left: 5px solid rgba(255, 255, 255, 0.5);
border-right: 5px solid rgba(0, 0, 0, 0.2);
border-bottom: 5px solid rgba(0, 0, 0, 0.2);
color: #555;
}
</style>
<svelte:window/>
<div style="text-align: center">
{#if key}
<kbd>{key === ' ' ? 'Space' : key}</kbd>
<p>{keyCode}</p>
{:else}
<p>Focus this window and press any key</p>
{/if}
</div>
</style>

@ -8,6 +8,17 @@
}
</script>
<svelte:window on:keydown={handleKeydown}/>
<div style="text-align: center">
{#if key}
<kbd>{key === ' ' ? 'Space' : key}</kbd>
<p>{keyCode}</p>
{:else}
<p>Focus this window and press any key</p>
{/if}
</div>
<style>
div {
display: flex;
@ -22,21 +33,10 @@
border-radius: 4px;
font-size: 6em;
padding: 0.2em 0.5em;
border-top: 5px solid rgba(255,255,255,0.5);
border-left: 5px solid rgba(255,255,255,0.5);
border-right: 5px solid rgba(0,0,0,0.2);
border-bottom: 5px solid rgba(0,0,0,0.2);
border-top: 5px solid rgba(255, 255, 255, 0.5);
border-left: 5px solid rgba(255, 255, 255, 0.5);
border-right: 5px solid rgba(0, 0, 0, 0.2);
border-bottom: 5px solid rgba(0, 0, 0, 0.2);
color: #555;
}
</style>
<svelte:window on:keydown={handleKeydown}/>
<div style="text-align: center">
{#if key}
<kbd>{key === ' ' ? 'Space' : key}</kbd>
<p>{keyCode}</p>
{:else}
<p>Focus this window and press any key</p>
{/if}
</div>

@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
</style>
</style>

@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
</style>
</style>

@ -11,15 +11,15 @@
});
</script>
<style>
div {
cursor: pointer;
line-height: 1.5;
}
</style>
<!-- the text will flash red whenever
the `todo` object changes -->
<div bind:this={div} on:click>
{todo.done ? '👍': ''} {todo.text}
</div>
<style>
div {
cursor: pointer;
line-height: 1.5;
}
</style>

@ -13,15 +13,15 @@
});
</script>
<style>
div {
cursor: pointer;
line-height: 1.5;
}
</style>
<!-- the text will flash red whenever
the `todo` object changes -->
<div bind:this={div} on:click>
{todo.done ? '👍': ''} {todo.text}
</div>
<style>
div {
cursor: pointer;
line-height: 1.5;
}
</style>

@ -7,4 +7,4 @@
<p>All rights reserved.</p>
<p>Copyright (c) 2019 Svelte Industries</p>
</div>
</Box>
</Box>

@ -1,9 +1,15 @@
<div class="box">
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
<style>
.box {
width: 300px;
border: 1px solid #aaa;
border-radius: 2px;
box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
padding: 1em;
margin: 0 0 1em 0;
@ -11,10 +17,4 @@
flex-direction: column;
gap: 1em;
}
</style>
<div class="box">
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
</style>

@ -7,4 +7,4 @@
<p>All rights reserved.</p>
<p>Copyright (c) 2019 Svelte Industries</p>
</svelte:fragment>
</Box>
</Box>

@ -1,9 +1,15 @@
<div class="box">
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
<style>
.box {
width: 300px;
border: 1px solid #aaa;
border-radius: 2px;
box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
padding: 1em;
margin: 0 0 1em 0;
@ -11,10 +17,4 @@
flex-direction: column;
gap: 1em;
}
</style>
<div class="box">
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
</style>

@ -8,6 +8,12 @@ In the example notice how we applied a flex layout with a gap of `1em` to the bo
```sv
<!-- Box.svelte -->
<div class="box">
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
<style>
.box {
display: flex;
@ -15,12 +21,6 @@ In the example notice how we applied a flex layout with a gap of `1em` to the bo
gap: 1em;
}
</style>
<div class="box">
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
```
However, the content in the footer is not spaced out according to this rhythm because wrapping it in a div created a new flow layout.

@ -17,13 +17,6 @@
}
</script>
<style>
article { margin: 0 0 1em 0; max-width: 800px }
h2, p { margin: 0 0 0.3em 0; }
audio { width: 100%; margin: 0.5em 0 1em 0; }
.playing { color: #ff3e00; }
</style>
<article class:playing={!paused}>
<h2>{title}</h2>
<p><strong>{composer}</strong> / performed by {performer}</p>
@ -35,4 +28,19 @@
controls
{src}
></audio>
</article>
</article>
<style>
article {
margin: 0 0 1em 0; max-width: 800px;
}
h2, p {
margin: 0 0 0.3em 0;
}
audio {
width: 100%; margin: 0.5em 0 1em 0;
}
.playing {
color: #ff3e00;
}
</style>

@ -25,13 +25,6 @@
}
</script>
<style>
article { margin: 0 0 1em 0; max-width: 800px }
h2, p { margin: 0 0 0.3em 0; }
audio { width: 100%; margin: 0.5em 0 1em 0; }
.playing { color: #ff3e00; }
</style>
<article class:playing={!paused}>
<h2>{title}</h2>
<p><strong>{composer}</strong> / performed by {performer}</p>
@ -43,4 +36,19 @@
controls
{src}
></audio>
</article>
</article>
<style>
article {
margin: 0 0 1em 0; max-width: 800px;
}
h2, p {
margin: 0 0 0.3em 0;
}
audio {
width: 100%; margin: 0.5em 0 1em 0;
}
.playing {
color: #ff3e00;
}
</style>

@ -31,13 +31,6 @@
}
</script>
<style>
article { margin: 0 0 1em 0; max-width: 800px }
h2, p { margin: 0 0 0.3em 0; }
audio { width: 100%; margin: 0.5em 0 1em 0; }
.playing { color: #ff3e00; }
</style>
<article class:playing={!paused}>
<h2>{title}</h2>
<p><strong>{composer}</strong> / performed by {performer}</p>
@ -49,4 +42,19 @@
controls
{src}
></audio>
</article>
</article>
<style>
article {
margin: 0 0 1em 0; max-width: 800px;
}
h2, p {
margin: 0 0 0.3em 0;
}
audio {
width: 100%; margin: 0.5em 0 1em 0;
}
.playing {
color: #ff3e00;
}
</style>

@ -33,6 +33,10 @@
});
</script>
{#each confetti as c}
<span style="left: {c.x}%; top: {c.y}%; transform: scale({c.r})">{c.character}</span>
{/each}
<style>
:global(body) {
overflow: hidden;
@ -42,8 +46,4 @@
position: absolute;
font-size: 5vw;
}
</style>
{#each confetti as c}
<span style="left: {c.x}%; top: {c.y}%; transform: scale({c.r})">{c.character}</span>
{/each}
</style>
Loading…
Cancel
Save