DEV Community

FSCSS tutorials for FSCSS tutorials

Posted on • Edited on

FSCSS variables

First implement FSCSS to your Web project:

<script src='https://wbf.tiiny.site/scripts/0/FS/fs.ex25.js'></script>
<style FSCSS>
//test FSCSS
</style>
Enter fullscreen mode Exit fullscreen mode

FSCSS Variables:
Think of variables as a way to store information that you want to reuse throughout your stylesheet. You can store things like colors, font stacks, or any CSS value you think you’ll want to reuse. FSCSS uses the $ symbol to make something a variable using the FSCSS $R() method or CSS :root Pseudo. Here’s an example:

FSCSS SYNTAX
Using FSCSS $r() method :

$R(body{
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
}) 
body {
  font: 100% $font-stack!;
  color: $primary-color!;
}
Enter fullscreen mode Exit fullscreen mode

Using CSS :root pseudo :

:root body{
$bg: red, linear-gradient(blue, green);
$color: #00f0f0;
}
Body{ background: $bg!;
Color: $color!;
} 
Enter fullscreen mode Exit fullscreen mode

When the FSCSS is processed, it takes the variables we define above and outputs normal CSS with our variable values placed in the CSS.
💖
Follow up

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay