Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 3 months ago

Results Summary Component using Svelte and TailwindCSS

svelte, tailwind-css
P
Carlos Samuel•350
@Crtykwod
A solution to the Results summary component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm most proud of successfully implementing my first Svelte project and creating a responsive design that closely matches the original design. The component structure turned out clean and reusable, and I'm particularly happy with how I used TypeScript to add type safety to the project.

If I were to do this project again, I would try to use Storybook, because a definitely didn't understand how it works.

What challenges did you encounter, and how did you overcome them?

The biggest challenges I faced were:

  1. Learning Svelte's syntax and reactivity model: Coming from React, I had to adjust to Svelte's different approach. I overcame this by carefully reading the documentation and following tutorial examples.
  2. Setting up Tailwind with SvelteKit: Initially, I struggled with the configuration. I solved this by studying the Tailwind documentation specifically for Svelte integration and experimenting until I got it working correctly.
  3. TypeScript integration: Adding proper types for dynamic data was challenging. I had to learn about TypeScript's type assertions and keyof operator to properly type the category styles mapping.
  4. Responsive design issues: The layout would break at certain viewport sizes. I solved this by using Tailwind's responsive utilities more effectively and testing on various screen sizes throughout development.
  5. Component props spreading: I wasn't familiar with how to pass all properties of an object to a component in Svelte. After some research, I discovered the spread syntax works similarly to React but with Svelte's own implementation details.
What specific areas of your project would you like help with?

I would appreciate feedback on:

  1. Component structure: Is my component breakdown logical and reusable? Should I have split any components further or combined any?
  2. TypeScript implementation: I'm not sure if my approach to typing the category styles is the most efficient. Is there a better way to handle dynamic object keys with TypeScript?
  3. CSS organization: I used Tailwind classes directly in the components. Would it be better to extract some common styles into separate CSS files or use Tailwind's @apply directive?
  4. Performance optimization: Are there any performance improvements I could make, especially regarding how I'm processing and transforming the data?
  5. Accessibility: I tried to make the component accessible, but I'd appreciate a review of my semantic HTML structure and ARIA attributes to ensure I'm following best practices.
  6. Animation: I'd like to add subtle animations when the component loads or when hovering over items. Any suggestions on how to implement this effectively in Svelte?
Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Carlos Samuel's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.