DEV Community

FSCSS tutorial
FSCSS tutorial

Posted on

Try this using FSCSS v1.1.6

Developer-friendly: Built-in callbacks and error reporting.
Maintainable: Clear structure, named parameters.

<script type="module">
  import { exec } from "https://cdn.jsdelivr.net/npm/fscss@1.1.6/e/xfscss.min.js";

  const DEBUG = true;

  function applyFSCSS({ type, content }) {
    exec({
      type,
      content,
      onSuccess: (styleElement) => {
        DEBUG && console.log("✅ FSCSS applied:", styleElement);
      },
      onError: (error) => {
        console.error("❌ Failed to apply FSCSS:", error);
        alert("⚠️ Could not load styles. Please try again later.");
      }
    });
  }

  applyFSCSS({
    type: "URL",
    content: "https://raw.githubusercontent.com/Figsh/style_sheet/refs/heads/main/ecard.min.fscss"
  });
</script>

Enter fullscreen mode Exit fullscreen mode

fscss/e/

Top comments (0)