Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gilnoy/tachyons-in-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gilnoy/tachyons-in-js

Tachyons for CSS in JS libraries

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Tachyons in JS

Tachyons for CSS in JS libraries

Examples written in React, but can be used with other libraries.

CSS In JS Libraries tested:

styled-components, Emotion, Glamor, Aphrodite, Glamorous (examples are in Demo.js file)

  • Customizable Media Queries
  • Media Queries for all utils
  • Customizable Colors
  • Supports ":hover", ":active", ":focus", ":visited" ":before", ":after" for all utils.
  • ...

Example - Styled Components


import styled from 'styled-components';
import { tachyonsToCss as tc } from 'tachyons-in-js';

const Href = styled.a`
  ${tc('flex tc pa3 bg-purple white h4 w4 f3 bg-red-m yellow-m hover-bg-green')}
`;

<Href>Tachyons and Styled Components</Href>

Example - Glamorous

import glamorous from 'glamorous';
import tc from 'tachyons-in-css';

const Href = glamorous.a(
  ${tc('flex tc pa3 bg-purple white h4 w4 f3 bg-red-m yellow-m hover-bg-green')}
);

<Href>Tachyons and Glamorous</Href>

Example - Add Skin

import { addSkin } from 'tacyons-in-js';
import tc from 'tachyons-in-css';

addSkin('peach-puff', '#ffdab9');

tc('bg-peach-puff peach-puff b--peach-puff');

Example - Adsd Media Query

import { addMediaQuery }  from 'tacyons-in-js/mediaQueries';

addMediaQuery("mobile", '@media only screen and (max-width: 600px)');
tc('bg-red-mobile w-100-mobile ');

Example - Set Config

Most Css in JS libraries are using the "&" sign before pseudo selectors and media queries. In Aphrodite you need to emit the "&" sign by modifying the config file.

import tachyonsConfig  from 'tacyons-in-js/config';

tachyonsConfig({
 pseudo: '' 
});

IN DEVELOPMENT

FAQs

Package last updated on 13 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc