Socket
Socket
Sign inDemoInstall

csstype

Package Overview
Dependencies
0
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    csstype

TypeScript definitions for CSS, generated by [data from MDN](https://github.com/mdn/data). It provides autocompletion and type checking for CSS properties and values.


Version published
Maintainers
1
Install size
41.0 kB
Created

Package description

What is csstype?

The csstype package provides TypeScript and Flow definitions for CSS properties and values. It is designed to enhance type safety and autocompletion when working with CSS in JavaScript and TypeScript projects. It includes types for CSS properties, pseudo-classes, pseudo-elements, and at-rules.

What are csstype's main functionalities?

Type definitions for CSS properties

Csstype allows developers to define CSS properties in an object with type checking. This ensures that the values assigned to CSS properties are valid according to the CSS specification.

{"color": "blue", "fontSize": "12px"}

Type definitions for pseudo-classes and pseudo-elements

Developers can use csstype to define styles for pseudo-classes and pseudo-elements with type safety, ensuring that the pseudo selectors and their associated styles are correctly typed.

{"::before": {"content": "'Before content'"}, ":hover": {"color": "red"}}

Type definitions for at-rules

Csstype includes type definitions for CSS at-rules like @media, allowing developers to write media queries with type-checked properties and values.

{"@media (min-width: 768px)": {"body": {"backgroundColor": "lightblue"}}}

Other packages similar to csstype

Readme

Source

CSSType

TypeScript definitions for CSS, generated by data from MDN. It provides autocompletion and type checking for CSS properties and values.

const style: CSS.Properties = {
  flexDirection: 'columns', // -> Type '"rows"' is not assignable to type 'FlexDirection'.
  opacity: '10%', // -> Type 'string' is not assignable to type 'number'.
  bakground: 'red', // -> Object literal may only specify known properties, and 'bakground' does not exist in type 'Properties'.
}

Getting started

$ npm install csstype@latest # For projects
$ npm install csstype@* # For libraries

FAQs

Last updated on 24 Sep 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc