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

marvelous-css-api

v1.1.1

Published

Simple css api, get all access

Downloads

16

Readme

Marvelous-css-api

Get all possible values and information about css attributes in JSON. Datas getted from SCRAPPER

** ALL ATTRIBUTES INFORMATION INCLUDING **

  • NAME
  • VALUES
  • DEFAULT VALUE
  • PARENT ATTRIBUTE
  • TYPES
  • REGEXP TESTER
  • BROWSERS SUPPORT
  • MOBILES SUPPORT
  • PSEUDO CLASSES
  • RULES
  • FUNCTIONS

Install & use

npm install --save marvelous-css-api
  1. Window.css
  2. Window.css.reference

1. Window.css

Just include css-api.js in your html page and see the magic in window.css

window.css = {

  reference: { ... },                             // the complete cssSheet (cssSheet.json at project root)

  getAttr: (attributeName){},                     // return attributeName object
  getValues: (attributeName){},                   // return possible values pattern form attributeName
  getDefaultValues: (attributeName){},            // return possible default values pattern from attributeName
  getChildrenNames: (attributeName){},            // return all children name
  getChildrenDefaultValues: (attributeName){},    // return all children default values
  getTypes: (attributeName){},                    // return all attribute types, with for each a regexp tester and units
  getSupports: (attributeName){},                 // return browsers/mobiles support
  
  isValid: (attributeName, type, expr){},         // return true/false if the expr is valid for attributeName and type
  isParent: (attributeName){},                    // return true/false is the attributeName is a parent attribute

  getPseudoClasses: (){},                         // return all CSS pseudo classes
  getFunctions: (){},                             // return all CSS functions
  getRules: (){},                                 // return all CSS rules
    
}

2. Access Window.css.reference

Just see the cssSheet.json

Exemple with a parent attribute:

"animation": {          // attribute Name
  "isParent": true,     // isParent -> can container multiple css attributes
  "children": {         // children names and default values
    "names": [          // multiple ways to interpret
      "animation-name animation-duration animation-timing-function animation-delay animation-iteration-count animation-direction animation-fill-mode animation-play-state"
    ],
    "childrenDefaultValues": {              // all default values for each child
      "animation-name": "none",
      "animation-duration": "0s",
      "animation-timing-function": "ease",
      "animation-delay": "0s",
      "animation-iteration-count": "1",
      "animation-direction": "normal",
      "animation-fill-mode": "none",
      "animation-play-state": "running"
    }
  },
  "values": [],
  "defaultValue": [                          // default value of parent
    "none 0s ease 0s 1 normal none running"
  ],
  "types": {},
  "supports": {                              // browsers and mobile support
    "browsers": {
      "Chrome": "Yes",
      "Firefox": "Yes",
      "Internet Explorer": "10+",
      "Safari": "Yes",
      "Opera": "Yes"
    },
    "mobiles": {
      "iOS Safari": "6.1+",
      "Android Browser": "2.3+",
      "Opera Mobile": "Yes",
      "Chrome for Android": "Yes",
      "Firefox for Android": "Yes",
      "IE Mobile": "10+"
    }
  }
},

Exemple with a child attribute

"animation-iteration-count": {        // child attribute name
  "isParent": false,                  // is not a parent :)
  "values": [                         // multiple values possible, here infinite or <number> (its a type)
    "infinite",
    "<number>"
  ],
  "defaultValue": [                   // default value
    "1"
  ],
  "types": {                          // types with units and regexp for test input
    "<number>": {
      "reTest": "^[+-]?\\d+(\\.\\d+)?$",
      "units": []
    }
  },
  "supports": {                       // browsers and mobile supports
    "browsers": {
      "Chrome": "Yes",
      "Firefox": "Yes",
      "Internet Explorer": "10+",
      "Safari": "Yes",
      "Opera": "Yes"
    },
    "mobiles": {
      "iOS Safari": "6.1+",
      "Android Browser": "2.3+",
      "Opera Mobile": "Yes",
      "Chrome for Android": "Yes",
      "Firefox for Android": "Yes",
      "IE Mobile": "10+"
    }
  }
},

TODO

  • more informations about pseudoClasses, rules and functions.
  • isolated types
  • better support functions

IMPORTANT NOTES

Support the crew with all issues and pull requests you can done !