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

@subjectmatter/mdcss-theme-tsm

v1.0.2

Published

TSM flavored theme for mdcss

Downloads

4

Readme

TSM Theme for MDCSS

This serves as a slightly branded theme for style guides built with mdcss.

Setup

To setup a style guide in a project, first install both mdcss and this style guide theme, mdcss-theme-tsm:

npm install mdcss @subjectmatter/mdcss-theme-tsm --save

Now that everything is installed, you'll need to set up a gulp task to build your style guide. Details on how to do so can be found here in the MDCSS documentation. Here is a sample:

import gulp from 'gulp'
import sass from 'gulp-sass'
import postcss from 'gulp-postcss'

gulp.task('styles', () => {
  return gulp.src('src/sass/style.scss')
    .pipe( sass().on('error', sass.logError) )
    .pipe( postcss([
      require('mdcss')({
        theme: require('@subjectmatter/mdcss-theme-tsm')
      })
    ]))
    .pipe( gulp.dest('./') )
})

Now, running gulp styles from the command line will generate your style guide, by default, in a styleguide/ directory at the root level of your project.

The best practice is to develop the style guide in isolation. When doing so, it's helpful to have a watcht task that will reload the style guide using browserync. A sample task for that would look like this:

import gulp         from 'gulp'
import browserSync  from 'browser-sync'

/*
 * A task for rebuilding your stylesheet when any scss files change
 */
gulp.task('styles', () => {
  return gulp.src('src/sass/style.scss')
    .pipe( sass().on('error', sass.logError) )
    .pipe( postcss([
      require('mdcss')({
        theme: require('@subjectmatter/mdcss-theme-tsm')
      })
    ]))
    .pipe( gulp.dest('./') )
})

/*
 * A task for moving the updates style.css into your styleguide
 */
gulp.task('styleguide', () => {
  return gulp.src('style.css')
    .pipe(gulp.dest('./styleguide'))
})

/*
 * Finally, a task to watch your styleguide for changes, serve it on 
 * localhost:4000 and reload it whenever it gets updated
 */
gulp.task('watch:styleguide', () => {

  browserSync.create().init({
    notify: true,
    port: 4000,
    ui: {
      port: 4001
    },
    server: 'styleguide',
    files: [
      'styleguide/index.html',
      'styleguide/style.css'
    ],
    open: false
  })

  gulp.watch('src/sass/**/*', ['styles'])

})

Further Reading