Git Product home page Git Product logo

insert-styles's Introduction

insert-styles Build Status Greenkeeper badge

Insert CSS styles into an HTML document

Install

$ npm install --save insert-styles

Usage

var insertStyles = require('insert-styles')

insertStyles('h1 { font-size: 14px }')
//=> <head><style> h1 { ... }</style></head>

API

insertStyles(styles, [options]) -> void

styles

Required. The string of styles to insert into the DOM.

options
id

Calling insertStyles with the same options.id multiple times will re-use the same <style> element each time.

Related

License

MIT © Ben Drucker

insert-styles's People

Contributors

ajoslin avatar bendrucker avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

insert-styles's Issues

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

The devDependency browserify was updated from 16.4.0 to 16.5.0.

🚨 View failing branch.

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

browserify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

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

Commits

The new version differs by 4 commits.

  • 506533c 16.5.0
  • 85489cc Update changelog.markdown
  • 4c04949 Merge pull request #1918 from browserify/custom-browser-field
  • 8213b64 Support custom names for "browser" field resolution

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Having trouble running unit tests in testron

I'm getting this (below) when trying to pipe the tests into testron. I'm having trouble finding anyone else with the same issue via google searches. You can see the SHA I'm on, with my npm/node versions in the screenshot:

I also tried Node v0.12 with no luck.

Ever bumped into this?

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

The devDependency tape was updated from 4.9.2 to 4.10.0.

🚨 View failing branch.

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

tape is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 60 commits.

  • 34b1832 v4.10.0
  • 6209882 Merge all orphaned tags: 'v1.1.2', 'v2.0.2', 'v2.1.1', 'v2.2.2', 'v2.3.3', 'v2.4.3', 'v2.5.1', 'v2.6.1', 'v2.7.3', 'v2.8.1', 'v2.9.1', 'v2.10.3', 'v2.11.1', 'v2.13.4', 'v2.14.0', 'v2.14.1', 'v3.6.1'
  • 82e7b26 [Deps] update glob
  • 9e3d25e [Dev Deps] update eslint, js-yaml
  • fd807f5 v1.1.2
  • eddbff5 v2.14.1
  • 6ce09d9 Minor test tweaks due to whitespace differences in v2 vs v4.
  • 71af8ba gitignore node_modules
  • 4c0d9e6 Merge pull request #268 from ljharb/throws_non_function_should_fail
  • d0a675f v3.6.1
  • d22b5fc Minor test tweaks due to output differences in v1 vs v4.
  • 8b3c1b7 Add missing concat-stream devDep
  • 3495543 gitignore node_modules
  • db81846 Merge pull request #268 from ljharb/throws_non_function_should_fail
  • 7ed6651 Minor test tweaks due to whitespace differences in v3 vs v4.

There are 60 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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

The devDependency browserify was updated from 16.3.0 to 16.4.0.

🚨 View failing branch.

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

browserify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

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

Commits

The new version differs by 5 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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

The devDependency standard was updated from 13.1.0 to 14.0.0-1.

🚨 View failing branch.

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

standard is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

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

Commits

The new version differs by 70 commits.

  • 7117e53 14.0.0-1
  • c1ebec6 Disallow spaces inside of curly braces in JSX expressions in children (react/jsx-curly-spacing)
  • 2d619f3 Require linebreaks in curly braces in JSX attributes and expressions to be consistent (react/jsx-curly-newline)
  • 5dfdc83 Require JSX event handler names to follow conventions (react/jsx-handler-names)
  • ff4ef49 Require JSX attributes and logical expressions to be indented correctly (react/jsx-indent)
  • 13e4bee Disallow missing key prop in JSX elements that likely require a key prop (react/jsx-key)
  • 29861dc Disallow accidental comments in JSX from being inserted as text nodes (react/jsx-no-comment-textnodes)
  • c852a11 Prevent usage of unsafe target='_blank' (react/jsx-no-target-blank)
  • 30eddfa Disallow unnecessary curly braces in JSX props and children. (react/jsx-curly-brace-presence)
  • d3d14a5 Require PascalCase for user-defined JSX components (react/jsx-pascal-case)
  • 93027d9 Require shorthand form for JSX fragments (react/jsx-fragments)
  • 093b7f0 Disallow multiple spaces between inline JSX props (react/jsx-props-no-multi-spaces)
  • 6ee9fb1 alphabetize rules
  • d179362 remove rule which already shipped
  • f8551e9 Require JSX closing bracket to be aligned with the opening tag (react/jsx-closing-bracket-location)

There are 70 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

return cache hit

Would be cool if the function would return an object with an indication if the cache has been hit or not... something like

{
   cached: boolean
}

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

There's no index.js on npm

I have no idea why, but the v1.2.0 publish is broken. There's no index.js in the package downloaded from npm.

Allow `options.id` to be passed in

I made a fork of insert-css that allows changes to existing CSS files to insert style contents into the same style element instead of creating a new one.

Then I made it so each time I insert styles via my transform, I pass in the filename as the id: https://github.com/ajoslin/stylin/blob/master/index.js#L67

This makes it so hot module reloading works: A reload of a JS file referencing a CSS file will cause the newest styles to be inserted into an existing <style> tag.

It's hopeless to submit a PR to substack's insert-css, that project is unmaintained (~10 open PRs, some years old).

Here's what I would like:

  • Allow id to be passed in to insert-styles, similar to my fork of insert-css
  • Change stackcss to use insert-styles: sheetify and css-extract.
  • Have sheetify pass a filename, if given, as the id to insertStyles.

And now finally, hot module reload would work perfectly with the sheetify stack.

cc @yoshuawuyts

I can do all of the PRs if these ideas sound "OK" to you two.

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.