Working with Design Files
One of the most valuable skills a frontend developer can have is the ability to accurately translate designs into code. This guide covers working with both JPEG designs (free tier) and Figma files (Pro tier), plus tips for achieving pixel-perfect results.
Table of contents
Understanding the Two Design Formats
Frontend Mentor provides designs in two formats, depending on your subscription:
| Feature | JPEG (Free) | Figma (Pro) | | --- | --- | --- | | Visual reference | Yes | Yes | | Exact measurements | No | Yes | | Precise colors | Style guide only | Inspect any element | | Export assets | No | Yes | | Font details | Style guide only | Full typography info | | Cost | Free | Pro subscription |
Both formats allow you to build great solutions, but they require different approaches.
Working with JPEG Designs (Free)
JPEG files are static images. You can't click into them to get measurements, but with the right techniques, you can still build accurate implementations.
Extracting Colors
The style guide provides your primary colors, but sometimes you need to verify or find additional colors:
Using Browser-Based Tools:
- Open your design image in a new browser tab
- Use a browser extension like ColorZilla or Eye Dropper
- Click on the color you want to identify
- Copy the hex, RGB, or HSL value
Using Computer Tools:
- macOS Preview: Use the color picker from Tools > Show Inspector
- Windows Paint: Use the color picker, then check Edit Colors
Tip: Always verify extracted colors against the style guide. JPEG compression can slightly alter colors, so the style guide values are more accurate.
Estimating Measurements
Without Figma, you'll need to estimate spacing, widths, and heights:
Method 1: Browser Zoom Technique
- Open the design image in your browser
- Zoom to 100% (actual size)
- Use your browser's developer tools to measure
- Create a transparent div and resize it over elements
Method 2: Image Editor Measurement
- Open the design in an image editor
- Use the ruler or measurement tools
- Measure distances in pixels
- Note these values for your CSS
Method 3: Screen Measurement Tools
Use dedicated measurement tools:
- macOS: Built-in Screenshot tool (Cmd+Shift+5) shows dimensions
- Windows: Microsoft PowerToys Screen Ruler
- Cross-platform: PixelSnap, Measurely
Identifying Fonts
The style guide tells you which fonts to use:
- Check the style guide for the font family name
- Note the weights needed (300, 400, 700, etc.)
- Visit Google Fonts
- Search for the font and select required weights
- Copy the embed code to your HTML
<link rel="preconnect" href="<https://fonts.googleapis.com>">
<link rel="preconnect" href="<https://fonts.gstatic.com>" crossorigin>
<link href="<https://fonts.google.com/css2?family=Inter:wght@400;700&display=swap>" rel="stylesheet">
Recommended Tools for JPEG Workflows
- ColorZilla (Browser extension) - Color picking
- PixelSnap (macOS) - Screen measurement
- PerfectPixel (Browser extension) - Overlay comparison
- Responsively (App) - Multi-device preview
Working with Figma Files (Pro)
Figma files provide everything you need for precise implementation. Here's how to make the most of them.
Accessing Your Figma Files
- From the Challenge page, click the Figma download button
- The design downloads to your computer
- Unzip/Extract the ZIP folder
- Import the
.figfile in Figma (browser or desktop app) - You now have full access to the file
Getting Exact Measurements
Selecting Elements:
- Click on any element in the design
- The right panel shows all properties
Measuring Spacing:
- Select an element
- Hold Alt/Option and hover over other elements
- Figma displays the exact distance in pixels
Checking Dimensions:
- Select any element
- Look at the right panel under "Frame" or "Layout"
- Width, height, and position are displayed
Extracting Precise Colors
In Figma, colors are exact:
- Select an element with the color you need
- Look at the "Fill" section in the right panel
- Click the color swatch to see values
- Copy as HEX, RGB, or HSL
For gradients:
- Select the element
- Click the fill color
- View all color stops and positions
- Note the gradient direction/angle
Inspecting Typography
Figma gives you complete font information:
- Select a text element
- Check the right panel under "Text"
- You'll see:
- Font family
- Font weight
- Font size
- Line height
- Letter spacing
/* Example of values from Figma */
.heading {
font-family: 'Outfit', sans-serif;
font-weight: 700;
font-size: 24px;
line-height: 1.2;
letter-spacing: -0.5px;
}
Exporting Assets
Sometimes you might need to export assets differently than provided:
- Select the element or group to export
- Look for "Export" at the bottom of the right panel
- Click the + button to add an export setting
- Choose format (PNG, SVG, JPG) and scale
- Click "Export [element name]"
Pro Tip: Export icons as SVG for crisp rendering at any size. Export photographs as JPG or WebP for smaller file sizes.
Understanding Auto Layout and Constraints
Figma designs often use Auto Layout, which shows you:
- How elements are meant to space themselves
- Padding and gap values
- How components should respond to content changes
This information is invaluable for building flexible, responsive components.
Tips for Accurate Implementation
Regardless of which design format you use, these tips help achieve precise results:
Use Browser DevTools Overlay
- Take a screenshot of your implementation
- Open the design image
- Use PerfectPixel or similar to overlay them
- Adjust opacity to spot differences
Set Up CSS Custom Properties Early
:root {
/* Colors from style guide */
--color-primary: hsl(215, 51%, 70%);
--color-secondary: hsl(178, 100%, 50%);
--color-neutral-dark: hsl(217, 54%, 11%);
/* Typography */
--font-family: 'Outfit', sans-serif;
--font-size-base: 18px;
/* Spacing (establish a system) */
--space-xs: 8px;
--space-sm: 16px;
--space-md: 24px;
--space-lg: 32px;
--space-xl: 48px;
}
Build Component by Component
- Identify distinct components in the design
- Build each one in isolation first
- Then assemble them into the full layout
- This makes debugging easier
Check at Multiple Breakpoints
- Test your implementation at various widths
- Compare against both mobile and desktop designs
- Ensure smooth transitions between breakpoints
- Watch for content overflow or awkward spacing
When It's OK to Deviate from the Design
Making an accurate replica is a goal, not an absolute rule. Here's when deviation is acceptable:
Accessibility Improvements
- Increase contrast if the design has insufficient color contrast
- Larger touch targets for better mobile usability
- Clearer focus states for keyboard navigation
Technical Constraints
- Font rendering differences across browsers and operating systems
- Sub-pixel rounding may cause 1px differences
- Responsive behavior between the provided breakpoints
Practical Decisions
- Performance optimizations that require different image formats
- Animation timing that feels better in practice
- Content edge cases the design didn't account for
Important: If you make intentional deviations, document them in your README when submitting. Explain why you made the change and how it improves the implementation.
Quick Reference: Measurement Checklist
When analyzing a design, gather these values:
- [ ] Primary and secondary colors
- [ ] Background colors
- [ ] Text colors for different contexts
- [ ] Font families and weights
- [ ] Font sizes for headings and body
- [ ] Line heights
- [ ] Letter spacing (if specified)
- [ ] Maximum content width
- [ ] Spacing between major sections
- [ ] Component padding
- [ ] Border radius values
- [ ] Shadow values (if any)
- [ ] Breakpoint widths
With these techniques, you'll be able to work confidently with any design format. The next guide explains how to understand and interpret the challenge brief.