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

Blog preview card

accessibility
Abdulgafar-Riro•250
@Abdulgafar-Riro
A solution to the Blog preview card 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?
  1. Responsive Design: I’m proud of how the blog preview card adjusts smoothly across various screen sizes. The use of CSS Flexbox and relative units like percentages and max-width ensured that the design remained consistent on mobile, tablet, and desktop views.

  2. Consistent Styling: I effectively utilized CSS variables for colors (--Yellow, --White, etc.), which helped maintain consistency and made the code easier to update.

  3. Typography: The integration of the Figtree font and proper font weights (500 and 800) provided a clean, modern look that closely matches the challenge design.

  4. Hover Effect: I added a subtle hover effect to the header, improving interactivity and enhancing the user experience.


What would you do differently next time?

  1. Dynamic Font Scaling: I would use clamp() to make font sizes more responsive. For example:

font-size: clamp(1rem, 2vw, 1.5rem);

This would ensure better typography scaling across devices.

  1. Add Animations: I’d include smooth animations for hover effects, such as transitioning colors or scaling elements, to make the card feel more interactive.

  2. Improve Accessibility: I’d ensure all elements have high contrast for readability and add ARIA roles and alt attributes for enhanced accessibility. For example:

  3. Optimize Media Queries: I’d refine the breakpoints to cater to more device ranges (e.g., large tablets) for an even smoother experience on intermediate screen sizes.

By improving these aspects, the blog preview card would be more polished, accessible, and engaging for all users.

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

Challenges Encountered and How I Overcame Them

  1. Achieving a Pixel-Perfect Design

Challenge: Replicating the exact spacing, alignment, and font sizes as shown in the challenge design was tricky, especially when matching the preview on different screen sizes.

Solution: I relied heavily on browser developer tools (DevTools) to inspect and tweak the margins, padding, and font sizes. I also used CSS variables to maintain consistency across elements.


  1. Making the Design Responsive

Challenge: Ensuring the blog preview card displayed consistently across mobile, tablet, and desktop devices. Balancing content scaling on intermediate screens was particularly difficult.

Solution: I implemented a mobile-first approach using @media queries and relative units like percentages, rem, and max-width. These adjustments ensured the layout scaled properly on different screen sizes.


  1. Integrating Typography

Challenge: Ensuring the correct font (Figtree) and weights (500, 800) were displayed as intended across browsers and devices.

Solution: I imported the font via Google Fonts, verified the weights worked correctly using fallback fonts, and explicitly set font-weight values where necessary.


  1. Handling Color Contrast

Challenge: Ensuring text contrast was readable, especially for the paragraph text on light backgrounds.

Solution: I tested the color contrast using tools like Contrast Checker to ensure compliance with WCAG standards. Adjustments were made to the --Gray500 color for better readability.


  1. Managing Hover Effects

Challenge: Designing hover effects that were noticeable but didn’t detract from the minimalist design.

Solution: I added subtle hover effects, such as color changes and smooth transitions, to the title. This maintained interactivity while keeping the design clean.


  1. Testing Across Devices

Challenge: Differences in rendering between mobile, tablet, and desktop browsers caused minor inconsistencies in spacing and scaling.

Solution: I used online tools like Responsive Design Checker and tested the project on physical devices to refine the breakpoints and styles.


Lessons Learned

These challenges reinforced the importance of:

  1. Using consistent design principles like CSS variables and a mobile-first approach.

  2. Testing frequently across different devices and screen sizes.

  3. Balancing creativity and functionality to create a polished final product.

Let me know if you'd like more details or insights!

What specific areas of your project would you like help with?

Specific Areas I'd Like Help With

  1. Responsiveness:

While the blog preview card is responsive across mobile and desktop, I would appreciate feedback on how to optimize the layout for tablet devices (e.g., 768px - 1024px).

Are there better ways to manage spacing and scaling for intermediate screen sizes?

  1. Typography Scaling:

I used fixed font sizes (rem and px) for headings and paragraphs. Would implementing clamp() or alternative methods for dynamic typography scaling improve the design?

Feedback on best practices for responsive typography is welcome.

  1. Hover Effects:

I added a simple hover effect to the card's title (color change). Are there suggestions for enhancing interactivity while maintaining a minimalist design?

  1. Accessibility:

I’ve ensured proper use of alt attributes for images and chosen colors with sufficient contrast. Are there additional accessibility improvements I can make (e.g., ARIA roles, focus states)?

  1. Code Organization:

Are there any improvements I can make to the HTML/CSS structure for better readability and maintainability?

Suggestions for reducing repetitive styles or enhancing reusability are appreciated.

  1. Performance:

Are there any recommendations for optimizing the CSS or HTML to improve performance, especially for users on slower devices or networks?

By addressing these areas, I hope to make the project more polished, efficient, and accessible. Any insights or tips would be greatly appreciated!

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Obas27•50
    @Obas27
    Posted 7 months ago

    Correct

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

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.

Oops! 😬

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

Log in with GitHub