npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@siimple/standalone

v0.3.1

Published

Build siimple CSS directly in your browser

Downloads

4

Readme

@siimple/standalone (Experimental)

Standalone script for using siimple directly in browser.

Note: this is an experimental package. API may change at any time. Please do not use it in production.

When to use @siimple/standalone

You should normally not use @siimple/standalone and use instead the CLI or the PostCSS plugin to generate a CSS file with the siimple styles.

However, there are some valid use cases:

  • For rapid prototyping and development purposes: you can get started with siimple without any additional setup, just including a simple <script> tag in your HTML file.
  • For using in some REPL environments, like JSFiddle or CodePen.

Alternatives to @siimple/standalone

You can use our Playground App to get started with siimple and for rapid prototyping without any other setup.

Installation

The easiest way for adding @siimple/standalone to your project is including a <script> tag in your HTML file importing this package from esm.sh CDN:

<script type="module" src="https://esm.sh/@siimple/standalone"></script>

NOTE: remember to add the type="module" attribute in the <script> tag.

You can also install this package in your project using npm:

 npm install --save @siimple/standalone

Usage

When loaded in a browser, @siimple/standalone will automatically compile the configuration provided in a <script> tag with the type="text/siimple" attribute and include the output CSS in a <style> tag.

<!-- Load @siimple/standalone -->
<script type="module" src="https://esm.sh/@siimple/standalone"></script>

<!-- Your custom configuration there -->
<script type="text/siimple">
    export default {
        // ...your theme configuration
    };
</script>

You can import additional packages to customize your theme. All packages will be imported automatically from the esm.sh CDN service:

<script type="text/siimple">
    import base from "@siimple/preset-base";

    export default {
        ...base,
        // ...your configuration
    };
</script>

Using an external script is also supported:

<script type="text/siimple" src="theme.js"></script>

Prevent Flash of Unstyled Content

You can prevent the common Flash of unstyled content effect in your webpage by adding a new <style> tag in your HTML with a .unstyled {display:none;} css, and assign this unstyled class to the <body> element to make it hidden by default:

<html>
    <head>
        <!-- ...your head content -->
        <style>.unstyled {display: none;}</style>
    </head>
    <body class="unstyled">
        <!-- ...your body content -->
    </body>
</html>

After siimple is compiled, it will automatically reset this class and display the content of your body styled.

License

MIT License.