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

silc

v0.4.0

Published

Simple, Intutive, Library of Components for Web Developers

Downloads

12

Readme

silc

Silc is a Simple, Intuitive, Library of Components for web developers. Unlike other "frameworks", silc is intentionally bare bones, focusing on functionality over uneccessary styles that you end up overriding later. Silc features purposeful and semantic HTML, minimal "vanilla" JavaScript, and SASS variables for easy customization. Silc includes the following modules:

Installation

After downloading silc, dependencies need to be installed with yarn or node.

npm install or yarn install

Development

Silc includes Fractal for component based development. Your own components can be added to the src/components folder. Static assets such as JavaScript, CSS and images will be served out of the build folder, but can also be configured to your specific needs by editing the fractal.js file. For more information, read the fractal guide.

To start the fractal development server:

npm run fractal or yarn fractal

Referencing images from within your component handlebars templates:

<img src="{{path '/img/image.png'}}" alt="">

Watch mode

If you do not wish to use Fractal, or simply want to watch for changes without launching a development server, you can run the watch command:

npm run watch or yarn watch

Webpack server

If you do not wish to use Fractal in development at all, you can use the webpack development server:

npm run serve or yarn serve

Building for production

To build your code for production, run the following:

npm run build:production or yarn build:production

This will generate build and fractal folders at the root of your project. The build folder contains all of your compiled assets (CSS, JavaScript etc.), while the fractal folder contains a static generated version of your Fractal component library, which can be used for previews and an online reference to your component library. See the Clearleft Fractal Library as an example.

Overriding styles

Each silc module contains a number of default SASS variables that can be easily overridden by adding the variable to the silc/_overrides.scss file. For example, to add your own breakpoints, you would create the following variable in the overrides file:

$silc-core--breakpoints: (
    ('sm', '(min-width:400px)'),
    ('md', '(min-width:600px)'),
    ('lg', '(min-width:1000px)'),
    ('xl', '(min-width:1400px)')
);

Extending classes

Some silc modules contain JavaScript classes that can be easily extended for your own needs. To extend a class, you need to import the class and then remove the call to the original module init function e.g. silcOffcanvasInit

import { SilcOffcanvas } from 'silc-offcanvas';
class MyOffcanvas extends SilcOffcanvas {

    constructor(el) {
        super(el);
    }

    protected toggle(event) {
        super.toggle(event); // Call parent toggle function
        console.log('Toggle!'); // Your own functionality
    }

}

You can then write your own init function to apply your new class to the appropriate elements.

[].forEach.call(document.querySelectorAll('.silc-offcanvas__trigger'), el => {
    new MyOffcanvas(el);
});