DEV Community

FSCSS tutorials for FSCSS tutorials

Posted on • Edited on

FSCSS variables

First implement FSCSS to your Web project:

<script src='https://combinatronics.io/Figsh/FSCSS/refs/heads/4.0.1/fscss_exec.js' async=""></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 $ method. Here’s an example:

FSCSS4 SYNTAX

$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 : FSCSS3 SYNTAX

: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

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more