Polymer/polymer-css-build

Name: polymer-css-build

Owner: polymer

Description: null

Created: 2016-04-02 00:26:40.0

Updated: 2018-01-13 01:19:21.0

Pushed: 2017-10-17 23:41:24.0

Homepage: null

Size: 96

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Polymer CSS Builder

Statically apply Polymer's CSS Mixin shim and CSS Custom Property shim (future work)

Use
  1. Vulcanize your project
  2. Checkout this tool
  3. npm install
  4. node bin/polymer-css-build path/to/vulcanized-file.html
  5. If multiple files are passed, they are expected to be shards of the same project
Build Types, Targeted Builds, and Polymer DOM modes

TL;DR: Set --build-for-shady if you don't use Polymer = {dom: 'shadow'} in your app.

Polymer by default uses ShadyDOM, a lightweight shim of the ShadowDOM spec. Real ShadowDOM can be used by setting Polymer = {dom: 'shadow'} before the HTMLImport for Polymer.

We define “targeted builds” to mean that when using the matching polymer-css-build type and Polymer dom setting, no additional runtime style work will be performed.

By default, polymer-css-build will produce built styles that are targeted for ShadowDOM. This is done because ShadowDOM styles can still be used in ShadyDOM mode with some runtime work, and the built styles are portable to both Polymer ShadyDOM and ShadowDOM scoping modes

However, if your app only uses ShadyDOM (the default of Polymer 1.x), then some runtime work is still done to convert CSS selectors.

To produce a targeted build for ShadyDOM, pass the --build-for-shady flag on the command line, or {'build-for-shady': true} to the library. However, these styles will only work with the ShadyDOM dom setting; the modifications for ShadyDOM remove some CSS selector information necessary for ShadowDOM.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.