Git Product home page Git Product logo

style-helper's Introduction

Style Helper

NPM version NPM downloads Build status Test coverage

Style Helper is a small utility for CSS-in-JS functions.

Installation

npm install style-helper --save

Usage

import { quote, url, objectify, merge } from 'style-helper'

Quote

Wrap a string in quotes (useful for the psuedo-element content property).

css({
  '&:before': {
    content: quote('Hello World') //=> `"Hello World"`
  }
})

URL

Wrap a string in the CSS url() function.

css({
  backgroundImage: url('image.png') //=> `url("image.png")`
})

Merge

Merge CSS objects recursively.

import { ellipsis } from './styles'

css(merge({ padding: 10 }, ellipsis)) //=> { padding: 10, ... }

Multi

Repeats the same style for multiple selectors (reference issue).

css(multi(['& .a', '& .b'], { margin: 10 }))

Objectify

Turn a list of arguments into an object (...[key, value]).

// Simple properties.
css(objectify(
  ['padding', 10],
  ['margin', 10]
)) //=> { padding: 10, margin: 10 }

// Array key for repeating property values.
css(objectify(
  [
    ['& .a', '& .b'],
    { margin: 10 }
  ]
)) //=> { '& .a': { margin: 10 }, '& .b': { margin: 10 } }

License

MIT license

style-helper's People

Contributors

blakeembrey avatar dependabot[bot] avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

style-helper's Issues

An in-range update of ts-jest is breaking the build 🚨

Version 20.0.14 of ts-jest just got published.

Branch Build failing 🚨
Dependency ts-jest
Current Version 20.0.13
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ts-jest is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes 20.0.14

Always remove outDir while computing TypeScript Config for transpiling. This was done to fix the behaviour of breakpoints in the project files when using VS Code (#309)

Commits

The new version differs by 4 commits.

  • 27a205b Always remove outDir while computing TypeScript Config for transpiling (#311)
  • 64bbc6e Add jsx to moduleFileExtensions in the documentation
  • 0772e12 Add note re const enum to README (#308)
  • 9cb6f86 docs: unify pkg name styling (#307) & rm VS Code limitation (#212)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of typescript is breaking the build 🚨

Version 2.5.2 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.5.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As typescript is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes TypeScript 2.5

For release notes, check out the release announcement

For new features, check out the What's new in TypeScript 2.5.

For the complete list of fixed issues, check out the issues fixed in TypeScript 2.5 RC and after TypeScript 2.5 RC.

Download:

Special thanks to all contributors to this release:

  • Anders Hejlsberg
  • Andrew Casey
  • Andy Hanson
  • Arthur Ozga
  • Basarat Ali Syed
  • Benjamin Lichtman
  • Daniel Rosenwasser
  • Francois Wouts
  • Jan Melcher
  • Kanchalai Tanglertsampan
  • Klaus Meinhardt
  • Kārlis Gaņģis
  • Matt Mitchell
  • Mine Starks
  • Mohamed Hegazy
  • Nathan Shively-Sanders
  • Paul van Brenk
  • Ron Buckton
  • Ryan Cavanaugh
  • Sheetal Nandi
  • Tingan Ho
  • Tycho Grouwstra
  • Wesley Wigham
Commits

The new version differs by 26 commits.

  • 171c664 Update LKG
  • 20da159 Merge pull request #18127 from RyanCavanaugh/port18120_release25
  • 6425ea2 Don't crash when a JS file appears in an inferred context
  • 6ffe829 Update LKG
  • 15a0d3f Update version
  • 2a2773f Update LKG
  • 187a21c Fix crash in name resolution with custom transforms and emitDecoratorMetadata
  • 62678cd Don't try to extract import to a method: simpler fix (#18054)
  • 3644771 Test for action description of code actions, and simplify description for extracting method to file (#18030) (#18044)
  • a39ae1f Fix crash when attempting to merge an import with a local declaration (#18032) (#18034)
  • 350c9f6 Call dynamic import transform on expression used by export equal statement (#18028) (#18033)
  • 0851f69 Added additional test
  • 01b7df6 Switch to arrow for ts class wrapper IIFE
  • 9bb1915 PR feedback
  • ec8f5cf Follow symbol through commonjs require for inferred class type

There are 26 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.