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

svelma-svelte-field

v0.2.4

Published

Bulma components for Svelte

Downloads

3

Readme

Svelma

Svelma is a set of UI components for Svelte based on the Bulma CSS framework.

Inspiration

Much thanks to the Buefy project! It provided the inspiration and lots of code examples for Svelma.. If you like Vue.js and Bulma, check it out.

Features

  • Extremely lightweight thanks to Svelte, a compile-only javascript framework. The bundle is 50K minified, 14K gzipped.
  • Components can be used independently, so a modern tree-shaking bundler will reduce the final bundle size even further.
  • Svelma does not bundle Bulma, so you are free to include it in your project however you wish, themes and all.

Documentation

See docs + demos site here

Quick Start

1. Create a svelte app from the template

https://github.com/sveltejs/template is a template repo for svelte. degit will scaffold the repo for you:

$ npx degit sveltejs/template my-svelma-project
$ cd my-svelma-project
$ npm install

NOTE: There are of course other ways to set up a project using svelte. This is just the quickest way to start.

2. Install svelma and dependencies via npm

Note that you'll need a CSS processing plugin for rollup so that you can import css files. Here we're using rollup-plugin-postcss. If you're going to use a <link> tag in your HTML you can skip the plugin and the import ... css statement below in step #2

$ npm install --save bulma svelma rollup-plugin-postcss

Add the postcss plugin to your rollup config (I don't think the order really matters):

// rollup.config.js
import postcss from 'rollup-plugin-postcss'

// ...

export default {
  // ... 
  plugins: [
    svelte({
      // ...
    }),

    postcss(),
  }
}

3. Import Bulma's CSS and Svelma components

<!-- App.svelte -->
<script>
  import 'bulma/css/bulma.css'
  import { Button } from 'svelma'
</script>

<Button type="is-primary">I'm a Button!</Button>

4. Include Font Awesome icons

From CDN in your HTML page:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"></link>

...or as an npm package imported into your root component:

$ npm install --save @fortawesome/fontawesome-free
<!-- App.svelte -->
<script>
  import 'bulma/css/bulma.css'
  import '@fortawesome/fontawesome-free/css/all.css'
</script>

SSR

If you are doing server-side rendering with Sapper, you'll need to import the .svelte files directly so that your app can compile them, rather than importing from the compiled module.

i.e.:

import Button from 'svelma/src/components/Button.svelte'

instead of

import { Button } from 'svelma'

Development

  1. Clone this repo: git clone https://github.com/c0bra/svelma.git
  2. Install dependencies:
    1. npm i && (cd docs; npm i)
    2. npm install -g semantic-release-cli commitizen
  3. Start the automated build and automated docs: npm run dev
  4. Open url that console prints in your browser

Commit

$ git cz

Publish

NOTE: CI should publish new versions using semantic-release automatically

$ npm version <version>
$ npm publish

License

Code released under MIT license.

Copyright ©, Brian Hann.