Skip to content

Commit b4d64f6

Browse files
committed
style: format code for consistency in Counter.svelte and TextInput.svelte; update layout in +page.svelte; fix import statement in vite.config.js
1 parent 75823a7 commit b4d64f6

File tree

4 files changed

+14
-20
lines changed

4 files changed

+14
-20
lines changed

src/lib/components/Counter.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
let count = $state(0);
44
const times = $derived(count == 1 ? 'time' : 'times');
55
6-
const {
7-
btnStyle = 'primary',
8-
className = ''
9-
} = $props();
6+
const { btnStyle = 'primary', className = '' } = $props();
107
</script>
118

129
<!-- onclick event handler is set to the increment function -->

src/lib/components/TextInput.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<script>
2-
let {
3-
placeholder = 'Enter your text here...',
4-
} = $props();
2+
let { placeholder = 'Enter your text here...' } = $props();
53
let inputText = $state('');
64
</script>
75

8-
96
<div class="mb-3">
107
<label for="exampleFormControlTextarea1" class="form-label">Insert Reactive Text Here:</label>
118
<textarea

src/routes/+page.svelte

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
/>
2020
</svelte:head>
2121

22-
<main class="svh-100">
22+
<main class="svh-100 py-5">
2323
<div class="container">
24-
<div class="row gap-4">
25-
<h1 class="h2">Welcome to SvelteKit + Bootstrap by Saaqi</h1>
24+
<div class="d-flex flex-column gap-3">
25+
<h1 class="">Welcome to SvelteKit + Bootstrap by Saaqi</h1>
2626

2727
<div class="d-flex gap-5">
2828
<Logos />
2929
</div>
3030

31-
<div class="container">
32-
<div class="row g-3 col-12 col-md-6">
31+
<div class="col-12 col-md-6">
32+
<div class="row g-2">
3333
<div class="col-6">
3434
<Counter btnStyle="secondary" />
3535
</div>
@@ -42,7 +42,7 @@
4242
body="Make muffins give attitude chase mice sweet beast under the bed all of a sudden go crazy behind the couch destroy couch intently stare at the same spot chew ipad power cord bag stretch claw drapes, leave dead animals as gifts attack feet flop over hopped up on goofballs hunt anything that moves hide when guests come over intrigued by the shower stand in front of the computer screen rub face on everything."
4343
/>
4444
</div>
45-
<div class="col-12">
45+
<div class="col-12 mb-3">
4646
<a
4747
href="https://pagespeed.web.dev/report?url={hrefLocation}"
4848
target="_blank"
@@ -58,7 +58,6 @@
5858
</div>
5959
</div>
6060

61-
6261
<p>
6362
Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation
6463
</p>

vite.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from 'vite';
33
import { sveltekit } from '@sveltejs/kit/vite';
44
import webfontDownload from 'vite-plugin-webfont-dl';
55
// import { purgeCSSPlugin } from '@fullhuman/postcss-purgecss';
6-
import htmlPurge from 'vite-plugin-purgecss'
6+
import htmlPurge from 'vite-plugin-purgecss';
77
import autoprefixer from 'autoprefixer';
88
import cssnano from 'cssnano';
99
const bootstrap = 'node_modules/bootstrap';
@@ -41,9 +41,10 @@ export default defineConfig({
4141
}),
4242

4343
/* ## Download Google Fonts and attach them with production build for offline use */
44-
IN_PRODUCTION && webfontDownload([
45-
'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'
46-
])
44+
IN_PRODUCTION &&
45+
webfontDownload([
46+
'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'
47+
])
4748
],
4849

4950
css: {
@@ -56,7 +57,7 @@ export default defineConfig({
5657
plugins: [
5758
// --- CSSNano is a modern CSS minifier based on the PostCSS ecosystem.
5859
cssnano({
59-
preset: ["default", { discardComments: { removeAll: true } }],
60+
preset: ['default', { discardComments: { removeAll: true } }]
6061
}),
6162
// --- Autoprefixer is used to add vendor prefixes to CSS rules using values from "Can I Use".
6263
autoprefixer

0 commit comments

Comments
 (0)