@JoramirJr
Posted
Hey, @kepper104!
Your solutions looks great!
One tip I'd give you is to use the tailwind.config file for every style related to your overall project; meaning, styling that tend to be shared throughout the project; one recurrent example of that are font patterns, as is usually described on the style guide.
For example, when it comes to fonts, I import them on my main.css file like so:
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@200;400&family=Bellefair:wght@200;400&display=swap');
Check out the file for the example above
then, on my tailwind.config, I usually do something like the following, as a key/value pair of the 'theme' object:
fontFamily: {
'Bellefair-Regular': ["Bellefair", "serif"],
'Barlow-Condensed-Regular': ["Barlow Condensed", "sans-serif"],
},
Check out the file for the example above
By gathering/organizing all of the default/shared styling in the tailwind.config file, you will better utilize the capabilities that TailwindCSS has to offer.
Btw, I have also used Svelte on recent projects; great tool!
Hope my tips are helpful!
Marked as helpful
@kepper104
Posted
@JoramirJr Wow, thanks so much for the feedback!
The reason I imported fonts inside each +page file separately was that I wanted to atomize each project and make each independent from the main Sveltekit server app. But I guess it indeed would be better to utilize the Tailwind functionality of adding a custom font app-wide and then using auto-generated Tailwind classes.
Thanks for the tip and the examples! Going to now go and change my imports ;)