DEV Community

FSCSS tutorials
FSCSS tutorials

Posted on β€’ Edited on

1

External FSCSS

How to add external .fscss file in HTML:
Step1:
create .fscss file, write in same FSCSS and CSS code
Example:

/* Variables */
$primary-color: midnightblue;
$bg-stack: #FF9955 url(image.png) No-repeat center;
$border: 1px solid #4CAF50;
$gradient: mx(#111, #222, #333, #444, #555,#000,'00f,');
/* body elem */
Body{
Background: linear-gradient(30deg, $gradient!#0f0);
color: $primary-color!;
} 
/* Select by name */
$(name: foo){
Background: $bg-stack!;
Border: $border!;
%2(width, height[:200px;])
} 
Enter fullscreen mode Exit fullscreen mode

Step2:
Add it to your HTML Using the HTML link tag with type='text/fscss'.
Example:

<head>
  <link href="style/style.fscss" rel="stylesheet" type='text/fscss'>
<script src="https://cdn.jsdelivr.net/gh/Figsh/FSCSS@4.0.1/fscss_exec.js" async=""></script>
</head>
<div name='foo'></div>
<style>
/* more style ... */
<style>
Enter fullscreen mode Exit fullscreen mode

Check out this Example:

<head>
  <link href="https://raw.githubusercontent.com/Figsh/FSCSS/refs/heads/main/test.fscss" rel="stylesheet" type='text/fscss'>
<script src="https://cdn.jsdelivr.net/gh/Figsh/FSCSS@4.0.1/fscss_exec.js" async=""></script>
</head>
<section id="box">
<div name=box></div>
<div name=box></div>
<div name=box></div>
<div name=box></div>
<div name=box></div>
<div name=box></div>
<div name=box></div>
<div name=box></div>
</section>
<style>
#box{
  width: 350px;
  height: 80px;
  border: 2px solid red;
  overflow-y: hidden;
  overflow-x: scroll;
  white-space: nowrap;
}
#box $(name: box){
  display: inline-block;
}
</style>
Enter fullscreen mode Exit fullscreen mode

Add external FSCSS to HTML using javascript

JavaScript:

(async function(){
let i = await import('https://cdn.jsdelivr.net/gh/Figsh/FSH@2.1.0/fshapi.js');
new i.exec(i.fromUrl, './styles/style.fscss');
})()
Enter fullscreen mode Exit fullscreen mode

Test code:

<div name='card'></div>
<script>
(async function(){
let i = await import('https://cdn.jsdelivr.net/gh/Figsh/FSH@2.1.0/fshapi.js');
var fscss = i.fromUrl;
new i.exec((fscss), ('https://raw.githubusercontent.com/Figsh/style_sheet/refs/heads/main/style.fscss'));
})()
</script>
Enter fullscreen mode Exit fullscreen mode

Same as:

<div name="card" class="card"></div>
<script src="https://cdn.jsdelivr.net/gh/Figsh/FSCSS@4.0.1/fscss_exec.js"></script>
<script>
var fscss = fromUrl;
exec((fscss), (`https://raw.githubusercontent.com/Figsh/style_sheet/refs/heads/main/style.fscss`));
</script>
Enter fullscreen mode Exit fullscreen mode

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo πŸ“Šβœ¨

Top comments (0)

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

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay