Aller au contenu principal

    We use cookies

    We use cookies to improve your experience. By continuing to browse, you accept their use.

    Learn more in our Cookies and Privacy

    SCSS Variables

    Export colors as SCSS/Sass variables. Use SCSS Variables free online with no signup, fast results and secure browser-based processing.

    $primary
    $secondary
    $accent
    $success
    $warning
    $error
    // Color Variables
    $primary: #6366f1;
    $secondary: #ec4899;
    $accent: #f59e0b;
    $success: #10b981;
    $warning: #f59e0b;
    $error: #ef4444;
    
    // Color Map
    $colors: (
      "primary": $primary,
      "secondary": $secondary,
      "accent": $accent,
      "success": $success,
      "warning": $warning,
      "error": $error
    );
    
    // Usage functions
    @function color($name) {
      @return map-get($colors, $name);
    }
    
    // Generate utility classes
    @each $name, $color in $colors {
      .bg-#{$name} {
        background-color: $color;
      }
      .text-#{$name} {
        color: $color;
      }
      .border-#{$name} {
        border-color: $color;
      }
    }
    // SCSS Mixins
    
    @mixin background($color) {
      background-color: $color;
      
      @if lightness($color) > 50% {
        color: #1a1a1a;
      } @else {
        color: #ffffff;
      }
    }
    
    @mixin button-variant($bg, $hover: darken($bg, 10%)) {
      background-color: $bg;
      border-color: $bg;
      
      @if lightness($bg) > 50% {
        color: #1a1a1a;
      } @else {
        color: #ffffff;
      }
      
      &:hover {
        background-color: $hover;
        border-color: $hover;
      }
    }
    
    // Usage
    .my-button {
      @include button-variant($primary);
    }
    
    .my-section {
      @include background($secondary);
    }

    SCSS Variables helps you work with colors directly in your browser.

    The tool is built for designers, developers and creators who need fast, reliable results.

    Supported formats

    SCSS
    Sass
    CSS
    Maps

    How it works

    1

    Step 1

    Open SCSS Variables

    2

    Step 2

    Enter or import your colors

    3

    Step 3

    Copy, export or reuse the result

    Common mistakes to avoid

    • Forgetting to check contrast can hurt readability.
    • Using too many colors can make a palette harder to apply.

    Pro tips

    • Keep your main colors as CSS variables.
    • Test your palette in both light and dark mode before publishing.

    Privacy guaranteed: everything is processed locally in your browser.

    Processing happens locally in your browser whenever possible. No account is required.

    SCSS Variables for your color projects

    Export colors as SCSS/Sass variables.

    SCSS Variables without precision loss

    Conversions and calculations run on exact values (HEX, RGB, HSL, OKLCH). No visual approximation: you get the color true to your design intent.

    SCSS Variables free online

    No signup, no software download required. SCSS Variables is 100% free and works in any browser. The free plan includes 10 uses per day.

    SCSS Variables fast and secure

    Processing happens directly in your browser for maximum speed. No data is sent to our servers: your colors and files stay private on your device.

    SCSS Variables for sharing and collaboration

    Export your results as HEX, RGB, HSL, CSS, JSON or copy them in one click. Perfect for sharing a color guide with your team or documenting a design system.

    Discover all our Color tools

    Extract, convert, generate palettes, gradients and WCAG contrasts in a few clicks.

    See all tools

    Related tools

    Guides and tutorials

    Learn how to use our tools with our detailed guides.

    Frequently asked questions

    Yes, the tool is available online for free.

    Processing happens in your browser whenever possible to protect your data.