DEV Community

FSCSS tutorials for FSCSS tutorials

Posted on • Edited on • Originally published at ln.run

Assigning one value to multiple properties FSCSS

Here is some FSCSS4 method that can assign one value to multiple properties in CSS.
Example:
The %2 method in FSCSS (Figured Shorthand Cascading Style Sheet) is used to assign the same value to two properties in a concise way. Instead of writing each property separately, you can group them together and provide the value once.

  • mx() or $m() $M(up to 6 properties separated with comma ':value;') -mxs() or $p() $P(up to 6 properties separated with comma 'value auto enclose with colon and semicolon') Example : $p(max-height, max-width,'500px')
  • %I( up to 10 properties separated with comma [:value;]) Example 1: %i(width, height[:480px;]) Example 2: %i(transform: rotateY, transform: skewX[(90deg);])
  • %6(up to 6 properties[:value;])
  • %5(up to 5 properties[:value;])
  • %4(up to 4 properties[:value;])
  • %3(up to 3 properties[:value;])
  • %2(up to 2 properties[:value;])
  • %1(1 property[:value;])

RGB color with %3()
rgb(%3([100,])1)
The method shared the value in 3 places.
CSS: rgb(100,100,100,1)
More examples:
FSCSS: rgb(%2(200[,200]))
CSS: rgb(200,200,200)

HSL color with %2()
hsl(200%2([,50%]))
The method shared the value in 2 places.
CSS: hsl(200,50%,50%)
More examples:
FSCSS: hsla(500%2([,25%]))
CSS : hsla(500,25%,25%)

Hexadecimal color with FSCSS

FSCSS: #%6([0])
CSS: #000000
FSCSS: #%3(F,D,8[0])
CSS: #F0D080

With 200px height 200px in FSCSS
FSCSS: %2(WIDTH, HEIGHT[:200PX;])
The %2 means that the parameter will not contain more than 2 properties,
The WIDTH is the first property and the HEIGHT is the second property,
And the value for both of them is enclosed in the square brackets.

CSS: width: 200px; height: 200px;

<script src='https://cdn.jsdelivr.net/gh/Figsh/FSCSS@4.0.1/fscss_exec.js' async=""></script>
<style>
//test FSCSS4
</style>
Enter fullscreen mode Exit fullscreen mode


AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more