This is a solution to the Time tracking dashboard challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
Make posible use SCSS in Sveltekit and make a global style file import whit the svelte.config.js file
**first** -> npm i -D svelte-preprocess sass
**second :
//svelte.config.js
import adapter from '@sveltejs/adapter-auto';
import preprocessor from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: preprocessor({
scss: {
includePaths: ['src/scss'],
prependData: `@import './global';`
}
}),
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;
Lear how to use the svelte-motion library
**first-> import the Motion tag -> import Motion from 'svelte-motion/src/motion/MotionSSR.svelte'
**second-> wrap the componente that u already styled:
<Motion
whileHover={buttonHover}
whileTap={buttonTap}
animate={$timeframe === text ? linkSelected : ''}
let:motion
>
<button on:click={changeTimeframe} use:motion>
{text}
</button>
</Motion>
And finally of course, learn how to use Svelte and Sveltkit (as a first interaction)
I wanna continue learning Svelte, It's something new to me and some times I get lost but it's amazing when you understand things.
Svelte Motion - This helped me for make the animations,Although it didn't seem intuitive to me, I was able to get the hang of it later.
Deploy on netlify - This is an amazing video which helped me to deploy this challenge on netlifly.
How to add SCSS to sveltekit - A Video that explain how to add SCSS in a easy way
Everything you need to build a Svelte project, powered by create-svelte
.
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.