15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/elements/my-app/views/pages/users.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 | Addy
14 | Rob
15 | Chuck
16 | Sam
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/elements/my-greeting/my-greeting.css:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | :host {
12 | display: block;
13 | }
14 |
15 | /*
16 | This class is used when we manage the focus start point (like when a new page
17 | is loaded). We typically move the focus start point to the first header in the
18 | page and don't want a focus ring to display. Instead the next time the user
19 | presses tab the focus ring will appear on the nearest, focusable element.
20 | */
21 | .focus-target {
22 | outline: none;
23 | }
24 |
--------------------------------------------------------------------------------
/app/elements/my-greeting/my-greeting.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
{{greeting}}
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/elements/my-greeting/my-greeting.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /* global Polymer */
12 |
13 | class MyGreeting {
14 | beforeRegister() {
15 | this.is = 'my-greeting';
16 | this.properties = {
17 | greeting: {
18 | type: String,
19 | value: 'Welcome!',
20 | notify: true
21 | }
22 | };
23 | }
24 | }
25 |
26 | Polymer(MyGreeting);
27 |
--------------------------------------------------------------------------------
/app/elements/my-list/my-list.css:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | :host {
12 | display: block;
13 | }
14 |
--------------------------------------------------------------------------------
/app/elements/my-list/my-list.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
{{item}}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/elements/my-list/my-list.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /* global Polymer */
12 |
13 | class MyList {
14 | beforeRegister() {
15 | this.is = 'my-list';
16 | this.properties = {
17 | items: {
18 | type: Array,
19 | notify: true
20 | }
21 | };
22 | }
23 | ready() {
24 | this.items = [
25 | 'Responsive Web App boilerplate',
26 | 'Iron Elements and Paper Elements',
27 | 'End-to-end Build Tooling (including Vulcanize)',
28 | 'Unit testing with Web Component Tester',
29 | 'Routing with Page.js',
30 | 'Offline support with the Platinum Service Worker Elements'
31 | ];
32 | }
33 | }
34 |
35 | Polymer(MyList);
36 |
--------------------------------------------------------------------------------
/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/favicon.ico
--------------------------------------------------------------------------------
/app/humans.txt:
--------------------------------------------------------------------------------
1 | # humanstxt.org
2 | # The humans responsible & technology colophon
3 |
4 | # TEAM
5 |
6 | Company:
7 | Developer:
8 | Site:
9 | From:
10 |
11 | # THANKS
12 |
13 | Names: Google, GitHub
14 |
15 | # SITE
16 |
17 | Boilerplate: Polymer Starter Kit Plus
18 | Design: Material Design
19 | Doctype: HTML5
20 | Language: English
21 | Library: Polymer
22 | Methodologies: Progressive Web App, SUIT CSS
23 | Standards: HTML5, CSS3, Web Components
24 | Tools: Autoprefixer, Babel, Browsersync, Gulp, Nunjucks, PostCSS
25 |
--------------------------------------------------------------------------------
/app/images/touch/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/apple-touch-icon.png
--------------------------------------------------------------------------------
/app/images/touch/chrome-splashscreen-icon-384x384.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/chrome-splashscreen-icon-384x384.png
--------------------------------------------------------------------------------
/app/images/touch/chrome-touch-icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/chrome-touch-icon-192x192.png
--------------------------------------------------------------------------------
/app/images/touch/icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/icon-128x128.png
--------------------------------------------------------------------------------
/app/images/touch/icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/icon-512x512.png
--------------------------------------------------------------------------------
/app/images/touch/icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/icon-72x72.png
--------------------------------------------------------------------------------
/app/images/touch/icon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/icon-96x96.png
--------------------------------------------------------------------------------
/app/images/touch/ms-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/ms-icon-144x144.png
--------------------------------------------------------------------------------
/app/images/touch/ms-touch-icon-144x144-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StartPolymer/polymer-starter-kit-plus-old/02726877e17987e6a50d191dcb15c4aa86858079/app/images/touch/ms-touch-icon-144x144-precomposed.png
--------------------------------------------------------------------------------
/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | {% include "head.html" %}
14 |
15 |
18 |
19 |
20 |
21 |
25 | {% include "skeleton.html" %}
26 |
27 |
28 |
29 |
30 |
31 |
35 |
38 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/app/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{$ appName $}",
3 | "short_name": "{$ appShortName $}",
4 | "icons": [{
5 | "src": "images/touch/icon-72x72.png",
6 | "sizes": "72x72",
7 | "type": "image/png"
8 | }, {
9 | "src": "images/touch/icon-96x96.png",
10 | "sizes": "96x96",
11 | "type": "image/png"
12 | }, {
13 | "src": "images/touch/icon-128x128.png",
14 | "sizes": "128x128",
15 | "type": "image/png"
16 | }, {
17 | "src": "images/touch/ms-touch-icon-144x144-precomposed.png",
18 | "sizes": "144x144",
19 | "type": "image/png"
20 | }, {
21 | "src": "images/touch/apple-touch-icon.png",
22 | "sizes": "152x152",
23 | "type": "image/png"
24 | }, {
25 | "src": "images/touch/chrome-touch-icon-192x192.png",
26 | "sizes": "192x192",
27 | "type": "image/png"
28 | },{
29 | "src": "images/touch/chrome-splashscreen-icon-384x384.png",
30 | "sizes": "384x384",
31 | "type": "image/png"
32 | },{
33 | "src": "images/touch/icon-512x512.png",
34 | "sizes": "512x512",
35 | "type": "image/png"
36 | }],
37 | "start_url": "./?utm_source=web_app_manifest",
38 | "display": "standalone",
39 | "theme_color": "{$ theme.manifest.themeColor $}",
40 | "background_color": "{$ theme.manifest.backgroundColor $}"
41 | }
42 |
--------------------------------------------------------------------------------
/app/metadata/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | baseUrl: '/',
3 | baseCanonicalUrl: 'https://polymer-starter-kit-plus.appspot.com/',
4 | // Google Analytics Tracking ID
5 | googleAnalyticsTrackingId: 'UA-XXXX-Y'
6 | };
7 |
--------------------------------------------------------------------------------
/app/metadata/general.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | appName: 'Polymer Starter Kit +',
3 | appShortName: 'PSK+',
4 | title: 'Polymer Starter Kit Plus',
5 | description: 'The future of the web today',
6 | charset: 'utf-8',
7 | lang: 'en',
8 | // Add to homescreen for Chrome on Android
9 | applicationName: 'PSK+',
10 | // Add to homescreen for Safari on iOS
11 | appleMobileWebAppTitle: 'PSK+'
12 | };
13 |
--------------------------------------------------------------------------------
/app/robots.txt:
--------------------------------------------------------------------------------
1 | # www.robotstxt.org
2 |
3 | User-agent: *
4 | Disallow:
5 |
--------------------------------------------------------------------------------
/app/scripts/app.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /* global CustomEvent, Polymer */
12 |
13 | (function(document) {
14 | 'use strict';
15 |
16 | // Grab a reference to our auto-binding template
17 | // and give it some initial binding values
18 | // Learn more about auto-binding templates at http://goo.gl/Dx1u2g
19 | let app = document.getElementById('app');
20 |
21 | // Debug mode
22 | app.debug = true;
23 |
24 | // Logger for debug mode
25 | let logger = text => {
26 | if (app.debug) {
27 | console.info(text);
28 | }
29 | };
30 |
31 | // Conditionally load the webcomponents polyfill if needed by the browser.
32 | // This feature detect will need to change over time as browsers implement
33 | // different features.
34 | var webComponentsSupported = ('registerElement' in document &&
35 | 'import' in document.createElement('link') &&
36 | 'content' in document.createElement('template'));
37 |
38 | function finishLazyLoading() {
39 | // (Optional) Use native Shadow DOM if it's available in the browser.
40 | // WARNING! This will mess up the page.js router which uses event delegation
41 | // and expects to receive events from anchor tags. These events get re-targeted
42 | // by the Shadow DOM to point to
43 | // window.Polymer = window.Polymer || {dom: 'shadow'};
44 |
45 | // When base-bundle.html with elements is loaded
46 | var onImportLoaded = function() {
47 | logger('Imports are loaded and elements have been registered!');
48 |
49 | // Remove skeleton
50 | var skeleton = document.getElementById('skeleton');
51 | skeleton.remove();
52 |
53 | if (webComponentsSupported) {
54 | // Emulate WebComponentsReady event for browsers supporting Web Components natively
55 | // (Chrome, Opera, Vivaldi)
56 | document.dispatchEvent(
57 | new CustomEvent('WebComponentsReady', {bubbles: true})
58 | );
59 | }
60 | };
61 |
62 | var elementsBaseBundle = document.getElementById('elementsBaseBundle');
63 |
64 | // Go if the async Import loaded quickly. Otherwise wait for it.
65 | // crbug.com/504944 - readyState never goes to complete until Chrome 46.
66 | // crbug.com/505279 - Resource Timing API is not available until Chrome 46.
67 | if (elementsBaseBundle.import && elementsBaseBundle.import.readyState === 'complete') {
68 | onImportLoaded();
69 | } else {
70 | elementsBaseBundle.addEventListener('load', onImportLoaded);
71 | }
72 | }
73 |
74 | if (!webComponentsSupported) {
75 | logger('Web Components aren\'t supported!');
76 | var script = document.createElement('script');
77 | script.async = true;
78 | script.src = 'bower_components/webcomponentsjs/webcomponents-lite.min.js';
79 | script.onload = finishLazyLoading;
80 | document.head.appendChild(script);
81 | } else {
82 | logger('Web Components are supported!');
83 | finishLazyLoading();
84 | }
85 |
86 | // Listen for template bound event to know when bindings
87 | // have resolved and content has been stamped to the page
88 | app.addEventListener('dom-change', () => {
89 | logger('Our app is ready to rock!');
90 | });
91 |
92 | // See https://github.com/Polymer/polymer/issues/1381
93 | window.addEventListener('WebComponentsReady', () => {
94 | /* imports are loaded and elements have been registered */
95 | });
96 |
97 | window.addEventListener('service-worker-error', e => {
98 | // Check to make sure caching is actually enabled—it won't be in the dev environment.
99 | if (!Polymer.dom(document).querySelector('platinum-sw-cache').disabled) {
100 | logger(e.detail);
101 | }
102 | });
103 |
104 | window.addEventListener('service-worker-installed', () => {
105 | // Check to make sure caching is actually enabled—it won't be in the dev environment.
106 | if (!Polymer.dom(document).querySelector('platinum-sw-cache').disabled) {
107 | app.$.infoToast.text = 'Caching complete! This app will work offline.';
108 | app.$.infoToast.show();
109 | }
110 | });
111 |
112 | window.addEventListener('service-worker-updated', e => {
113 | // Check to make sure caching is actually enabled—it won't be in the dev environment.
114 | if (!Polymer.dom(document).querySelector('platinum-sw-cache').disabled) {
115 | logger(e.detail);
116 | }
117 | });
118 |
119 | // Main area's paper-scroll-header-panel custom condensing transformation of
120 | // the headerTitle in the middle-container and the bottom title in the bottom-container.
121 | // The headerTitle is moved to top and shrunk on condensing. The bottom sub title
122 | // is shrunk to nothing on condensing.
123 | window.addEventListener('paper-header-transform', e => {
124 | let headerTitle = app.querySelector('.Main-headerTitle');
125 | let headerSubTitle = app.querySelector('.Main-headerSubTitle');
126 | let headerMiddleBar = app.querySelector('.Main-headerMiddleBar');
127 | let headerBottomBar = app.querySelector('.Main-headerBottomBar');
128 | let detail = e.detail;
129 | let heightDiff = detail.height - detail.condensedHeight;
130 | let yRatio = Math.min(1, detail.y / heightDiff);
131 | let yRatio2 = Math.min(1, detail.y / (heightDiff + 30));
132 | // headerTitle max size when condensed. The smaller the number the smaller the condensed size.
133 | var maxMiddleScale = 0.70;
134 | var auxHeight = heightDiff - detail.y;
135 | var auxScale = heightDiff / (1 - maxMiddleScale);
136 | var scaleMiddle = Math.max(maxMiddleScale, auxHeight / auxScale + maxMiddleScale);
137 | var scaleBottom = 1 - yRatio;
138 |
139 | // Move/translate headerMiddleContent and headerBottomContent
140 | if (window.matchMedia('(min-width: 600px)').matches) {
141 | Polymer.Base.transform(`translate3d(0,${yRatio2 * 100}%,0)`, headerMiddleBar);
142 | } else {
143 | Polymer.Base.transform(`translate3d(${yRatio * 18}px,${yRatio2 * 100}%,0)`,
144 | headerMiddleBar);
145 | Polymer.Base.transform(`translate3d(${yRatio * 18}px,0,0)`, headerBottomBar);
146 | }
147 |
148 | // Scale headerTitle
149 | Polymer.Base.transform(`scale(${scaleMiddle}) translateZ(0)`, headerTitle);
150 | // Scale headerSubTitle
151 | Polymer.Base.transform(`scale(${scaleBottom}) translateZ(0)`, headerSubTitle);
152 | });
153 |
154 | })(document);
155 |
--------------------------------------------------------------------------------
/app/scripts/routing.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /* global page */
12 |
13 | // We use Page.js for routing. This is a Micro
14 | // client-side router inspired by the Express router
15 | // More info: https://visionmedia.github.io/page.js/
16 |
17 | // Sets app default base URL
18 | let baseUrl = '/';
19 |
20 | if (window.location.port === '') { // if production
21 | // Uncomment baseURL below and
22 | // set baseURL to '/your-pathname/' if running from folder in production
23 | // baseUrl = '/polymer-starter-kit-plus/';
24 |
25 | // Removes end / from baseUrl which page.base requires for production
26 | page.base(baseUrl.replace(/\/$/, ''));
27 | }
28 |
29 | let app = document.getElementById('app');
30 |
31 | window.addEventListener('upgraded', () => {
32 | app.baseUrl = baseUrl;
33 | });
34 |
35 | // Utility function to listen to an event on a node once.
36 | function once(node, event, fn, args) {
37 | var self = this;
38 | var listener = function() {
39 | fn.apply(self, args);
40 | node.removeEventListener(event, listener, false);
41 | };
42 | node.addEventListener(event, listener, false);
43 | }
44 |
45 | // Middleware
46 | function scrollToTop(ctx, next) {
47 | function setData() {
48 | app.scrollPageToTop();
49 | }
50 |
51 | // Check if element prototype has not been upgraded yet
52 | if (!app.upgraded) {
53 | once(app, 'upgraded', setData);
54 | } else {
55 | setData();
56 | }
57 | next();
58 | }
59 |
60 | function closeDrawer(ctx, next) {
61 | function setData() {
62 | app.closeDrawer();
63 | }
64 |
65 | // Check if element prototype has not been upgraded yet
66 | if (!app.upgraded) {
67 | once(app, 'upgraded', setData);
68 | } else {
69 | setData();
70 | }
71 | next();
72 | }
73 |
74 | function setFocus(selected){
75 | document.querySelector('section[data-route="' + selected + '"]').focus();
76 | }
77 |
78 | // Routes
79 | page('*', scrollToTop, closeDrawer, (ctx, next) => {
80 | next();
81 | });
82 |
83 | function setHomePage() {
84 | function setData() {
85 | app.route = 'home';
86 | app.pageTitle = 'Polymer';
87 | app.pageSubTitle = 'The future of the web today';
88 | setFocus(app.route);
89 | }
90 |
91 | // Check if element prototype has not been upgraded yet
92 | if (!app.upgraded) {
93 | once(app, 'upgraded', setData);
94 | } else {
95 | setData();
96 | }
97 | }
98 |
99 | page('/', () => {
100 | setHomePage();
101 | });
102 |
103 | page(baseUrl, () => {
104 | setHomePage();
105 | });
106 |
107 | page('/users', () => {
108 | function setData() {
109 | app.route = 'users';
110 | app.pageTitle = 'Users';
111 | app.pageSubTitle = 'This is the users section';
112 | setFocus(app.route);
113 | }
114 |
115 | // Check if element prototype has not been upgraded yet
116 | if (!app.upgraded) {
117 | once(app, 'upgraded', setData);
118 | } else {
119 | setData();
120 | }
121 | });
122 |
123 | page('/users/:name', ctx => {
124 | function setData() {
125 | app.route = 'user-info';
126 | app.pageTitle = 'User information';
127 | app.pageSubTitle = 'This is the users section';
128 | app.params = ctx.params;
129 | setFocus(app.route);
130 | }
131 |
132 | // Check if element prototype has not been upgraded yet
133 | if (!app.upgraded) {
134 | once(app, 'upgraded', setData);
135 | } else {
136 | setData();
137 | }
138 | });
139 |
140 | page('/contact', () => {
141 | function setData() {
142 | app.route = 'contact';
143 | app.pageTitle = 'Contact';
144 | app.pageSubTitle = 'This is the contact section';
145 | setFocus(app.route);
146 | }
147 |
148 | // Check if element prototype has not been upgraded yet
149 | if (!app.upgraded) {
150 | once(app, 'upgraded', setData);
151 | } else {
152 | setData();
153 | }
154 | });
155 |
156 | page('/settings', () => {
157 | function setData() {
158 | app.route = 'settings';
159 | app.pageTitle = 'Settings';
160 | app.pageSubTitle = 'Edit your settings';
161 | setFocus(app.route);
162 | }
163 |
164 | // Check if element prototype has not been upgraded yet
165 | if (!app.upgraded) {
166 | once(app, 'upgraded', setData);
167 | } else {
168 | setData();
169 | }
170 | });
171 |
172 | // 404
173 | page('*', ctx => {
174 | function setData() {
175 | let url = ctx.path.substr(1);
176 | app.$.confirmToast.text = `Can't find: ${url}. Redirected you to Home Page`;
177 | app.$.confirmToast.show();
178 | page.redirect(baseUrl);
179 | }
180 |
181 | // Check if element prototype has not been upgraded yet
182 | if (!app.upgraded) {
183 | once(app, 'upgraded', setData);
184 | } else {
185 | setData();
186 | }
187 | });
188 |
189 | page({
190 | // add #! before urls
191 | // https://developers.google.com/webmasters/ajax-crawling/docs/learn-more
192 | // Disable for Firebase or GAE
193 | hashbang: false
194 | });
195 |
--------------------------------------------------------------------------------
/app/sw-import.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | importScripts('bower_components/platinum-sw/service-worker.js');
12 |
--------------------------------------------------------------------------------
/app/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 | Elements Test Runner
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/test/my-greeting-basic.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 | my-greeting-basic
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/test/my-list-basic.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 | my-list-basic
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/app/themes/default-theme/breakpoints.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /*
11 | Material Design Adaptive UI Breakpoints
12 | http://www.google.com/design/spec/layout/adaptive-ui.html#adaptive-ui-breakpoints
13 |
14 | Following SUIT CSS naming conventions
15 | https://github.com/suitcss/utils-size#configuration
16 | https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md
17 | */
18 |
19 | /* Single level of content hierarchy on the screen */
20 | @custom-media --sm-viewport (max-width: 599px);
21 |
22 | /* Two levels of content hierarchy on the screen */
23 | @custom-media --md-viewport (min-width: 600px);
24 |
25 | /* Max screen widths */
26 | @custom-media --lg-viewport (min-width: 1600px);
27 |
28 | /* Grid Breakpoints */
29 | @custom-media --4-col-grid (orientation: portrait) and (max-width: 479px);
30 | @custom-media --8-col-grid (orientation: portrait) and (min-width: 480px) and (max-width: 839px);
31 | @custom-media --12-col-grid (orientation: portrait) and (min-width: 840px);
32 |
33 | /* Phone Breakpoints */
34 | @custom-media --sm-phone (orientation: portrait) and (max-width: 359px);
35 | @custom-media --md-phone (orientation: portrait) and (min-width: 360px) and (max-width: 399px);
36 | @custom-media --lg-phone (orientation: portrait) and (min-width: 400px);
37 | @custom-media --sm-phone-landscape (orientation: landscape) and (max-width: 599px);
38 | @custom-media --md-phone-landscape (orientation: landscape) and (min-width: 600px) and (max-width: 719px);
39 | @custom-media --lg-phone-landscape (orientation: landscape) and (min-width: 720px);
40 |
41 | /* Tablet Breakpoints */
42 | @custom-media --sm-tablet (orientation: portrait) and (max-width: 719px);
43 | @custom-media --lg-tablet (orientation: portrait) and (min-width: 720px);
44 | @custom-media --sm-tablet-landscape (orientation: landscape) and (max-width: 1023px);
45 | @custom-media --lg-tablet-landscape (orientation: landscape) and (min-width: 1024px);
46 |
47 | /* Query order hack for CSS MQPacker
48 | https://github.com/hail2u/node-css-mqpacker#known-issues
49 | */
50 | @media (--sm-viewport) {
51 | /* */
52 | }
53 |
54 | @media (--md-viewport) {
55 | /* */
56 | }
57 |
58 | @media (--lg-viewport) {
59 | /* */
60 | }
61 |
62 | @media (--4-col-grid) {
63 | /* */
64 | }
65 |
66 | @media (--8-col-grid) {
67 | /* */
68 | }
69 |
70 | @media (--12-col-grid) {
71 | /* */
72 | }
73 |
74 | @media (--sm-phone) {
75 | /* */
76 | }
77 |
78 | @media (--md-phone) {
79 | /* */
80 | }
81 |
82 | @media (--lg-phone) {
83 | /* */
84 | }
85 |
86 | @media (--sm-phone-landscape) {
87 | /* */
88 | }
89 |
90 | @media (--md-phone-landscape) {
91 | /* */
92 | }
93 |
94 | @media (--lg-phone-landscape) {
95 | /* */
96 | }
97 |
98 | @media (--sm-tablet) {
99 | /* */
100 | }
101 |
102 | @media (--lg-tablet) {
103 | /* */
104 | }
105 |
106 | @media (--sm-tablet-landscape) {
107 | /* */
108 | }
109 |
110 | @media (--lg-tablet-landscape) {
111 | /* */
112 | }
113 |
--------------------------------------------------------------------------------
/app/themes/default-theme/colors.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /*
11 | Colors are from file on URL https://github.com/PolymerElements/paper-styles/blob/master/color.html
12 | */
13 |
14 | :root {
15 | /* Material Design color palette for Google products */
16 | --google-red-100: #f4c7c3;
17 | --google-red-300: #e67c73;
18 | --google-red-500: #db4437;
19 | --google-red-700: #c53929;
20 |
21 | --google-blue-100: #c6dafc;
22 | --google-blue-300: #7baaf7;
23 | --google-blue-500: #4285f4;
24 | --google-blue-700: #3367d6;
25 |
26 | --google-green-100: #b7e1cd;
27 | --google-green-300: #57bb8a;
28 | --google-green-500: #0f9d58;
29 | --google-green-700: #0b8043;
30 |
31 | --google-yellow-100: #fce8b2;
32 | --google-yellow-300: #f7cb4d;
33 | --google-yellow-500: #f4b400;
34 | --google-yellow-700: #f09300;
35 |
36 | --google-grey-100: #f5f5f5;
37 | --google-grey-300: #e0e0e0;
38 | --google-grey-500: #9e9e9e;
39 | --google-grey-700: #616161;
40 |
41 | /* Material Design color palette from online spec document */
42 | --paper-red-50: #ffebee;
43 | --paper-red-100: #ffcdd2;
44 | --paper-red-200: #ef9a9a;
45 | --paper-red-300: #e57373;
46 | --paper-red-400: #ef5350;
47 | --paper-red-500: #f44336;
48 | --paper-red-600: #e53935;
49 | --paper-red-700: #d32f2f;
50 | --paper-red-800: #c62828;
51 | --paper-red-900: #b71c1c;
52 | --paper-red-a100: #ff8a80;
53 | --paper-red-a200: #ff5252;
54 | --paper-red-a400: #ff1744;
55 | --paper-red-a700: #d50000;
56 |
57 | --paper-pink-50: #fce4ec;
58 | --paper-pink-100: #f8bbd0;
59 | --paper-pink-200: #f48fb1;
60 | --paper-pink-300: #f06292;
61 | --paper-pink-400: #ec407a;
62 | --paper-pink-500: #e91e63;
63 | --paper-pink-600: #d81b60;
64 | --paper-pink-700: #c2185b;
65 | --paper-pink-800: #ad1457;
66 | --paper-pink-900: #880e4f;
67 | --paper-pink-a100: #ff80ab;
68 | --paper-pink-a200: #ff4081;
69 | --paper-pink-a400: #f50057;
70 | --paper-pink-a700: #c51162;
71 |
72 | --paper-purple-50: #f3e5f5;
73 | --paper-purple-100: #e1bee7;
74 | --paper-purple-200: #ce93d8;
75 | --paper-purple-300: #ba68c8;
76 | --paper-purple-400: #ab47bc;
77 | --paper-purple-500: #9c27b0;
78 | --paper-purple-600: #8e24aa;
79 | --paper-purple-700: #7b1fa2;
80 | --paper-purple-800: #6a1b9a;
81 | --paper-purple-900: #4a148c;
82 | --paper-purple-a100: #ea80fc;
83 | --paper-purple-a200: #e040fb;
84 | --paper-purple-a400: #d500f9;
85 | --paper-purple-a700: #a0f;
86 |
87 | --paper-deep-purple-50: #ede7f6;
88 | --paper-deep-purple-100: #d1c4e9;
89 | --paper-deep-purple-200: #b39ddb;
90 | --paper-deep-purple-300: #9575cd;
91 | --paper-deep-purple-400: #7e57c2;
92 | --paper-deep-purple-500: #673ab7;
93 | --paper-deep-purple-600: #5e35b1;
94 | --paper-deep-purple-700: #512da8;
95 | --paper-deep-purple-800: #4527a0;
96 | --paper-deep-purple-900: #311b92;
97 | --paper-deep-purple-a100: #b388ff;
98 | --paper-deep-purple-a200: #7c4dff;
99 | --paper-deep-purple-a400: #651fff;
100 | --paper-deep-purple-a700: #6200ea;
101 |
102 | --paper-indigo-50: #e8eaf6;
103 | --paper-indigo-100: #c5cae9;
104 | --paper-indigo-200: #9fa8da;
105 | --paper-indigo-300: #7986cb;
106 | --paper-indigo-400: #5c6bc0;
107 | --paper-indigo-500: #3f51b5;
108 | --paper-indigo-600: #3949ab;
109 | --paper-indigo-700: #303f9f;
110 | --paper-indigo-800: #283593;
111 | --paper-indigo-900: #1a237e;
112 | --paper-indigo-a100: #8c9eff;
113 | --paper-indigo-a200: #536dfe;
114 | --paper-indigo-a400: #3d5afe;
115 | --paper-indigo-a700: #304ffe;
116 |
117 | --paper-blue-50: #e3f2fd;
118 | --paper-blue-100: #bbdefb;
119 | --paper-blue-200: #90caf9;
120 | --paper-blue-300: #64b5f6;
121 | --paper-blue-400: #42a5f5;
122 | --paper-blue-500: #2196f3;
123 | --paper-blue-600: #1e88e5;
124 | --paper-blue-700: #1976d2;
125 | --paper-blue-800: #1565c0;
126 | --paper-blue-900: #0d47a1;
127 | --paper-blue-a100: #82b1ff;
128 | --paper-blue-a200: #448aff;
129 | --paper-blue-a400: #2979ff;
130 | --paper-blue-a700: #2962ff;
131 |
132 | --paper-light-blue-50: #e1f5fe;
133 | --paper-light-blue-100: #b3e5fc;
134 | --paper-light-blue-200: #81d4fa;
135 | --paper-light-blue-300: #4fc3f7;
136 | --paper-light-blue-400: #29b6f6;
137 | --paper-light-blue-500: #03a9f4;
138 | --paper-light-blue-600: #039be5;
139 | --paper-light-blue-700: #0288d1;
140 | --paper-light-blue-800: #0277bd;
141 | --paper-light-blue-900: #01579b;
142 | --paper-light-blue-a100: #80d8ff;
143 | --paper-light-blue-a200: #40c4ff;
144 | --paper-light-blue-a400: #00b0ff;
145 | --paper-light-blue-a700: #0091ea;
146 |
147 | --paper-cyan-50: #e0f7fa;
148 | --paper-cyan-100: #b2ebf2;
149 | --paper-cyan-200: #80deea;
150 | --paper-cyan-300: #4dd0e1;
151 | --paper-cyan-400: #26c6da;
152 | --paper-cyan-500: #00bcd4;
153 | --paper-cyan-600: #00acc1;
154 | --paper-cyan-700: #0097a7;
155 | --paper-cyan-800: #00838f;
156 | --paper-cyan-900: #006064;
157 | --paper-cyan-a100: #84ffff;
158 | --paper-cyan-a200: #18ffff;
159 | --paper-cyan-a400: #00e5ff;
160 | --paper-cyan-a700: #00b8d4;
161 |
162 | --paper-teal-50: #e0f2f1;
163 | --paper-teal-100: #b2dfdb;
164 | --paper-teal-200: #80cbc4;
165 | --paper-teal-300: #4db6ac;
166 | --paper-teal-400: #26a69a;
167 | --paper-teal-500: #009688;
168 | --paper-teal-600: #00897b;
169 | --paper-teal-700: #00796b;
170 | --paper-teal-800: #00695c;
171 | --paper-teal-900: #004d40;
172 | --paper-teal-a100: #a7ffeb;
173 | --paper-teal-a200: #64ffda;
174 | --paper-teal-a400: #1de9b6;
175 | --paper-teal-a700: #00bfa5;
176 |
177 | --paper-green-50: #e8f5e9;
178 | --paper-green-100: #c8e6c9;
179 | --paper-green-200: #a5d6a7;
180 | --paper-green-300: #81c784;
181 | --paper-green-400: #66bb6a;
182 | --paper-green-500: #4caf50;
183 | --paper-green-600: #43a047;
184 | --paper-green-700: #388e3c;
185 | --paper-green-800: #2e7d32;
186 | --paper-green-900: #1b5e20;
187 | --paper-green-a100: #b9f6ca;
188 | --paper-green-a200: #69f0ae;
189 | --paper-green-a400: #00e676;
190 | --paper-green-a700: #00c853;
191 |
192 | --paper-light-green-50: #f1f8e9;
193 | --paper-light-green-100: #dcedc8;
194 | --paper-light-green-200: #c5e1a5;
195 | --paper-light-green-300: #aed581;
196 | --paper-light-green-400: #9ccc65;
197 | --paper-light-green-500: #8bc34a;
198 | --paper-light-green-600: #7cb342;
199 | --paper-light-green-700: #689f38;
200 | --paper-light-green-800: #558b2f;
201 | --paper-light-green-900: #33691e;
202 | --paper-light-green-a100: #ccff90;
203 | --paper-light-green-a200: #b2ff59;
204 | --paper-light-green-a400: #76ff03;
205 | --paper-light-green-a700: #64dd17;
206 |
207 | --paper-lime-50: #f9fbe7;
208 | --paper-lime-100: #f0f4c3;
209 | --paper-lime-200: #e6ee9c;
210 | --paper-lime-300: #dce775;
211 | --paper-lime-400: #d4e157;
212 | --paper-lime-500: #cddc39;
213 | --paper-lime-600: #c0ca33;
214 | --paper-lime-700: #afb42b;
215 | --paper-lime-800: #9e9d24;
216 | --paper-lime-900: #827717;
217 | --paper-lime-a100: #f4ff81;
218 | --paper-lime-a200: #eeff41;
219 | --paper-lime-a400: #c6ff00;
220 | --paper-lime-a700: #aeea00;
221 |
222 | --paper-yellow-50: #fffde7;
223 | --paper-yellow-100: #fff9c4;
224 | --paper-yellow-200: #fff59d;
225 | --paper-yellow-300: #fff176;
226 | --paper-yellow-400: #ffee58;
227 | --paper-yellow-500: #ffeb3b;
228 | --paper-yellow-600: #fdd835;
229 | --paper-yellow-700: #fbc02d;
230 | --paper-yellow-800: #f9a825;
231 | --paper-yellow-900: #f57f17;
232 | --paper-yellow-a100: #ffff8d;
233 | --paper-yellow-a200: #ff0;
234 | --paper-yellow-a400: #ffea00;
235 | --paper-yellow-a700: #ffd600;
236 |
237 | --paper-amber-50: #fff8e1;
238 | --paper-amber-100: #ffecb3;
239 | --paper-amber-200: #ffe082;
240 | --paper-amber-300: #ffd54f;
241 | --paper-amber-400: #ffca28;
242 | --paper-amber-500: #ffc107;
243 | --paper-amber-600: #ffb300;
244 | --paper-amber-700: #ffa000;
245 | --paper-amber-800: #ff8f00;
246 | --paper-amber-900: #ff6f00;
247 | --paper-amber-a100: #ffe57f;
248 | --paper-amber-a200: #ffd740;
249 | --paper-amber-a400: #ffc400;
250 | --paper-amber-a700: #ffab00;
251 |
252 | --paper-orange-50: #fff3e0;
253 | --paper-orange-100: #ffe0b2;
254 | --paper-orange-200: #ffcc80;
255 | --paper-orange-300: #ffb74d;
256 | --paper-orange-400: #ffa726;
257 | --paper-orange-500: #ff9800;
258 | --paper-orange-600: #fb8c00;
259 | --paper-orange-700: #f57c00;
260 | --paper-orange-800: #ef6c00;
261 | --paper-orange-900: #e65100;
262 | --paper-orange-a100: #ffd180;
263 | --paper-orange-a200: #ffab40;
264 | --paper-orange-a400: #ff9100;
265 | --paper-orange-a700: #ff6500;
266 |
267 | --paper-deep-orange-50: #fbe9e7;
268 | --paper-deep-orange-100: #ffccbc;
269 | --paper-deep-orange-200: #ffab91;
270 | --paper-deep-orange-300: #ff8a65;
271 | --paper-deep-orange-400: #ff7043;
272 | --paper-deep-orange-500: #ff5722;
273 | --paper-deep-orange-600: #f4511e;
274 | --paper-deep-orange-700: #e64a19;
275 | --paper-deep-orange-800: #d84315;
276 | --paper-deep-orange-900: #bf360c;
277 | --paper-deep-orange-a100: #ff9e80;
278 | --paper-deep-orange-a200: #ff6e40;
279 | --paper-deep-orange-a400: #ff3d00;
280 | --paper-deep-orange-a700: #dd2c00;
281 |
282 | --paper-brown-50: #efebe9;
283 | --paper-brown-100: #d7ccc8;
284 | --paper-brown-200: #bcaaa4;
285 | --paper-brown-300: #a1887f;
286 | --paper-brown-400: #8d6e63;
287 | --paper-brown-500: #795548;
288 | --paper-brown-600: #6d4c41;
289 | --paper-brown-700: #5d4037;
290 | --paper-brown-800: #4e342e;
291 | --paper-brown-900: #3e2723;
292 |
293 | --paper-grey-50: #fafafa;
294 | --paper-grey-100: #f5f5f5;
295 | --paper-grey-200: #eee;
296 | --paper-grey-300: #e0e0e0;
297 | --paper-grey-400: #bdbdbd;
298 | --paper-grey-500: #9e9e9e;
299 | --paper-grey-600: #757575;
300 | --paper-grey-700: #616161;
301 | --paper-grey-800: #424242;
302 | --paper-grey-900: #212121;
303 |
304 | --paper-blue-grey-50: #eceff1;
305 | --paper-blue-grey-100: #cfd8dc;
306 | --paper-blue-grey-200: #b0bec5;
307 | --paper-blue-grey-300: #90a4ae;
308 | --paper-blue-grey-400: #78909c;
309 | --paper-blue-grey-500: #607d8b;
310 | --paper-blue-grey-600: #546e7a;
311 | --paper-blue-grey-700: #455a64;
312 | --paper-blue-grey-800: #37474f;
313 | --paper-blue-grey-900: #263238;
314 |
315 | /* opacity for dark text on a light background */
316 | --dark-divider-opacity: 0.12;
317 | --dark-disabled-opacity: 0.38; /* or hint text or icon */
318 | --dark-secondary-opacity: 0.54;
319 | --dark-primary-opacity: 0.87;
320 |
321 | /* opacity for light text on a dark background */
322 | --light-divider-opacity: 0.12;
323 | --light-disabled-opacity: 0.3; /* or hint text or icon */
324 | --light-secondary-opacity: 0.7;
325 | --light-primary-opacity: 1;
326 | }
327 |
--------------------------------------------------------------------------------
/app/themes/default-theme/colors.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /*
11 | Colors are from file on URL https://github.com/PolymerElements/paper-styles/blob/master/color.html
12 | */
13 |
14 | module.exports = {
15 |
16 | /* Material Design color palette for Google products */
17 |
18 | 'google-red-100': '#f4c7c3',
19 | 'google-red-300': '#e67c73',
20 | 'google-red-500': '#db4437',
21 | 'google-red-700': '#c53929',
22 |
23 | 'google-blue-100': '#c6dafc',
24 | 'google-blue-300': '#7baaf7',
25 | 'google-blue-500': '#4285f4',
26 | 'google-blue-700': '#3367d6',
27 |
28 | 'google-green-100': '#b7e1cd',
29 | 'google-green-300': '#57bb8a',
30 | 'google-green-500': '#0f9d58',
31 | 'google-green-700': '#0b8043',
32 |
33 | 'google-yellow-100': '#fce8b2',
34 | 'google-yellow-300': '#f7cb4d',
35 | 'google-yellow-500': '#f4b400',
36 | 'google-yellow-700': '#f09300',
37 |
38 | 'google-grey-100': '#f5f5f5',
39 | 'google-grey-300': '#e0e0e0',
40 | 'google-grey-500': '#9e9e9e',
41 | 'google-grey-700': '#616161',
42 |
43 | /* Material Design color palette from online spec document */
44 |
45 | 'paper-red-50': '#ffebee',
46 | 'paper-red-100': '#ffcdd2',
47 | 'paper-red-200': '#ef9a9a',
48 | 'paper-red-300': '#e57373',
49 | 'paper-red-400': '#ef5350',
50 | 'paper-red-500': '#f44336',
51 | 'paper-red-600': '#e53935',
52 | 'paper-red-700': '#d32f2f',
53 | 'paper-red-800': '#c62828',
54 | 'paper-red-900': '#b71c1c',
55 | 'paper-red-a100': '#ff8a80',
56 | 'paper-red-a200': '#ff5252',
57 | 'paper-red-a400': '#ff1744',
58 | 'paper-red-a700': '#d50000',
59 |
60 | 'paper-pink-50': '#fce4ec',
61 | 'paper-pink-100': '#f8bbd0',
62 | 'paper-pink-200': '#f48fb1',
63 | 'paper-pink-300': '#f06292',
64 | 'paper-pink-400': '#ec407a',
65 | 'paper-pink-500': '#e91e63',
66 | 'paper-pink-600': '#d81b60',
67 | 'paper-pink-700': '#c2185b',
68 | 'paper-pink-800': '#ad1457',
69 | 'paper-pink-900': '#880e4f',
70 | 'paper-pink-a100': '#ff80ab',
71 | 'paper-pink-a200': '#ff4081',
72 | 'paper-pink-a400': '#f50057',
73 | 'paper-pink-a700': '#c51162',
74 |
75 | 'paper-purple-50': '#f3e5f5',
76 | 'paper-purple-100': '#e1bee7',
77 | 'paper-purple-200': '#ce93d8',
78 | 'paper-purple-300': '#ba68c8',
79 | 'paper-purple-400': '#ab47bc',
80 | 'paper-purple-500': '#9c27b0',
81 | 'paper-purple-600': '#8e24aa',
82 | 'paper-purple-700': '#7b1fa2',
83 | 'paper-purple-800': '#6a1b9a',
84 | 'paper-purple-900': '#4a148c',
85 | 'paper-purple-a100': '#ea80fc',
86 | 'paper-purple-a200': '#e040fb',
87 | 'paper-purple-a400': '#d500f9',
88 | 'paper-purple-a700': '#aa00ff',
89 |
90 | 'paper-deep-purple-50': '#ede7f6',
91 | 'paper-deep-purple-100': '#d1c4e9',
92 | 'paper-deep-purple-200': '#b39ddb',
93 | 'paper-deep-purple-300': '#9575cd',
94 | 'paper-deep-purple-400': '#7e57c2',
95 | 'paper-deep-purple-500': '#673ab7',
96 | 'paper-deep-purple-600': '#5e35b1',
97 | 'paper-deep-purple-700': '#512da8',
98 | 'paper-deep-purple-800': '#4527a0',
99 | 'paper-deep-purple-900': '#311b92',
100 | 'paper-deep-purple-a100': '#b388ff',
101 | 'paper-deep-purple-a200': '#7c4dff',
102 | 'paper-deep-purple-a400': '#651fff',
103 | 'paper-deep-purple-a700': '#6200ea',
104 |
105 | 'paper-indigo-50': '#e8eaf6',
106 | 'paper-indigo-100': '#c5cae9',
107 | 'paper-indigo-200': '#9fa8da',
108 | 'paper-indigo-300': '#7986cb',
109 | 'paper-indigo-400': '#5c6bc0',
110 | 'paper-indigo-500': '#3f51b5',
111 | 'paper-indigo-600': '#3949ab',
112 | 'paper-indigo-700': '#303f9f',
113 | 'paper-indigo-800': '#283593',
114 | 'paper-indigo-900': '#1a237e',
115 | 'paper-indigo-a100': '#8c9eff',
116 | 'paper-indigo-a200': '#536dfe',
117 | 'paper-indigo-a400': '#3d5afe',
118 | 'paper-indigo-a700': '#304ffe',
119 |
120 | 'paper-blue-50': '#e3f2fd',
121 | 'paper-blue-100': '#bbdefb',
122 | 'paper-blue-200': '#90caf9',
123 | 'paper-blue-300': '#64b5f6',
124 | 'paper-blue-400': '#42a5f5',
125 | 'paper-blue-500': '#2196f3',
126 | 'paper-blue-600': '#1e88e5',
127 | 'paper-blue-700': '#1976d2',
128 | 'paper-blue-800': '#1565c0',
129 | 'paper-blue-900': '#0d47a1',
130 | 'paper-blue-a100': '#82b1ff',
131 | 'paper-blue-a200': '#448aff',
132 | 'paper-blue-a400': '#2979ff',
133 | 'paper-blue-a700': '#2962ff',
134 |
135 | 'paper-light-blue-50': '#e1f5fe',
136 | 'paper-light-blue-100': '#b3e5fc',
137 | 'paper-light-blue-200': '#81d4fa',
138 | 'paper-light-blue-300': '#4fc3f7',
139 | 'paper-light-blue-400': '#29b6f6',
140 | 'paper-light-blue-500': '#03a9f4',
141 | 'paper-light-blue-600': '#039be5',
142 | 'paper-light-blue-700': '#0288d1',
143 | 'paper-light-blue-800': '#0277bd',
144 | 'paper-light-blue-900': '#01579b',
145 | 'paper-light-blue-a100': '#80d8ff',
146 | 'paper-light-blue-a200': '#40c4ff',
147 | 'paper-light-blue-a400': '#00b0ff',
148 | 'paper-light-blue-a700': '#0091ea',
149 |
150 | 'paper-cyan-50': '#e0f7fa',
151 | 'paper-cyan-100': '#b2ebf2',
152 | 'paper-cyan-200': '#80deea',
153 | 'paper-cyan-300': '#4dd0e1',
154 | 'paper-cyan-400': '#26c6da',
155 | 'paper-cyan-500': '#00bcd4',
156 | 'paper-cyan-600': '#00acc1',
157 | 'paper-cyan-700': '#0097a7',
158 | 'paper-cyan-800': '#00838f',
159 | 'paper-cyan-900': '#006064',
160 | 'paper-cyan-a100': '#84ffff',
161 | 'paper-cyan-a200': '#18ffff',
162 | 'paper-cyan-a400': '#00e5ff',
163 | 'paper-cyan-a700': '#00b8d4',
164 |
165 | 'paper-teal-50': '#e0f2f1',
166 | 'paper-teal-100': '#b2dfdb',
167 | 'paper-teal-200': '#80cbc4',
168 | 'paper-teal-300': '#4db6ac',
169 | 'paper-teal-400': '#26a69a',
170 | 'paper-teal-500': '#009688',
171 | 'paper-teal-600': '#00897b',
172 | 'paper-teal-700': '#00796b',
173 | 'paper-teal-800': '#00695c',
174 | 'paper-teal-900': '#004d40',
175 | 'paper-teal-a100': '#a7ffeb',
176 | 'paper-teal-a200': '#64ffda',
177 | 'paper-teal-a400': '#1de9b6',
178 | 'paper-teal-a700': '#00bfa5',
179 |
180 | 'paper-green-50': '#e8f5e9',
181 | 'paper-green-100': '#c8e6c9',
182 | 'paper-green-200': '#a5d6a7',
183 | 'paper-green-300': '#81c784',
184 | 'paper-green-400': '#66bb6a',
185 | 'paper-green-500': '#4caf50',
186 | 'paper-green-600': '#43a047',
187 | 'paper-green-700': '#388e3c',
188 | 'paper-green-800': '#2e7d32',
189 | 'paper-green-900': '#1b5e20',
190 | 'paper-green-a100': '#b9f6ca',
191 | 'paper-green-a200': '#69f0ae',
192 | 'paper-green-a400': '#00e676',
193 | 'paper-green-a700': '#00c853',
194 |
195 | 'paper-light-green-50': '#f1f8e9',
196 | 'paper-light-green-100': '#dcedc8',
197 | 'paper-light-green-200': '#c5e1a5',
198 | 'paper-light-green-300': '#aed581',
199 | 'paper-light-green-400': '#9ccc65',
200 | 'paper-light-green-500': '#8bc34a',
201 | 'paper-light-green-600': '#7cb342',
202 | 'paper-light-green-700': '#689f38',
203 | 'paper-light-green-800': '#558b2f',
204 | 'paper-light-green-900': '#33691e',
205 | 'paper-light-green-a100': '#ccff90',
206 | 'paper-light-green-a200': '#b2ff59',
207 | 'paper-light-green-a400': '#76ff03',
208 | 'paper-light-green-a700': '#64dd17',
209 |
210 | 'paper-lime-50': '#f9fbe7',
211 | 'paper-lime-100': '#f0f4c3',
212 | 'paper-lime-200': '#e6ee9c',
213 | 'paper-lime-300': '#dce775',
214 | 'paper-lime-400': '#d4e157',
215 | 'paper-lime-500': '#cddc39',
216 | 'paper-lime-600': '#c0ca33',
217 | 'paper-lime-700': '#afb42b',
218 | 'paper-lime-800': '#9e9d24',
219 | 'paper-lime-900': '#827717',
220 | 'paper-lime-a100': '#f4ff81',
221 | 'paper-lime-a200': '#eeff41',
222 | 'paper-lime-a400': '#c6ff00',
223 | 'paper-lime-a700': '#aeea00',
224 |
225 | 'paper-yellow-50': '#fffde7',
226 | 'paper-yellow-100': '#fff9c4',
227 | 'paper-yellow-200': '#fff59d',
228 | 'paper-yellow-300': '#fff176',
229 | 'paper-yellow-400': '#ffee58',
230 | 'paper-yellow-500': '#ffeb3b',
231 | 'paper-yellow-600': '#fdd835',
232 | 'paper-yellow-700': '#fbc02d',
233 | 'paper-yellow-800': '#f9a825',
234 | 'paper-yellow-900': '#f57f17',
235 | 'paper-yellow-a100': '#ffff8d',
236 | 'paper-yellow-a200': '#ffff00',
237 | 'paper-yellow-a400': '#ffea00',
238 | 'paper-yellow-a700': '#ffd600',
239 |
240 | 'paper-amber-50': '#fff8e1',
241 | 'paper-amber-100': '#ffecb3',
242 | 'paper-amber-200': '#ffe082',
243 | 'paper-amber-300': '#ffd54f',
244 | 'paper-amber-400': '#ffca28',
245 | 'paper-amber-500': '#ffc107',
246 | 'paper-amber-600': '#ffb300',
247 | 'paper-amber-700': '#ffa000',
248 | 'paper-amber-800': '#ff8f00',
249 | 'paper-amber-900': '#ff6f00',
250 | 'paper-amber-a100': '#ffe57f',
251 | 'paper-amber-a200': '#ffd740',
252 | 'paper-amber-a400': '#ffc400',
253 | 'paper-amber-a700': '#ffab00',
254 |
255 | 'paper-orange-50': '#fff3e0',
256 | 'paper-orange-100': '#ffe0b2',
257 | 'paper-orange-200': '#ffcc80',
258 | 'paper-orange-300': '#ffb74d',
259 | 'paper-orange-400': '#ffa726',
260 | 'paper-orange-500': '#ff9800',
261 | 'paper-orange-600': '#fb8c00',
262 | 'paper-orange-700': '#f57c00',
263 | 'paper-orange-800': '#ef6c00',
264 | 'paper-orange-900': '#e65100',
265 | 'paper-orange-a100': '#ffd180',
266 | 'paper-orange-a200': '#ffab40',
267 | 'paper-orange-a400': '#ff9100',
268 | 'paper-orange-a700': '#ff6500',
269 |
270 | 'paper-deep-orange-50': '#fbe9e7',
271 | 'paper-deep-orange-100': '#ffccbc',
272 | 'paper-deep-orange-200': '#ffab91',
273 | 'paper-deep-orange-300': '#ff8a65',
274 | 'paper-deep-orange-400': '#ff7043',
275 | 'paper-deep-orange-500': '#ff5722',
276 | 'paper-deep-orange-600': '#f4511e',
277 | 'paper-deep-orange-700': '#e64a19',
278 | 'paper-deep-orange-800': '#d84315',
279 | 'paper-deep-orange-900': '#bf360c',
280 | 'paper-deep-orange-a100': '#ff9e80',
281 | 'paper-deep-orange-a200': '#ff6e40',
282 | 'paper-deep-orange-a400': '#ff3d00',
283 | 'paper-deep-orange-a700': '#dd2c00',
284 |
285 | 'paper-brown-50': '#efebe9',
286 | 'paper-brown-100': '#d7ccc8',
287 | 'paper-brown-200': '#bcaaa4',
288 | 'paper-brown-300': '#a1887f',
289 | 'paper-brown-400': '#8d6e63',
290 | 'paper-brown-500': '#795548',
291 | 'paper-brown-600': '#6d4c41',
292 | 'paper-brown-700': '#5d4037',
293 | 'paper-brown-800': '#4e342e',
294 | 'paper-brown-900': '#3e2723',
295 |
296 | 'paper-grey-50': '#fafafa',
297 | 'paper-grey-100': '#f5f5f5',
298 | 'paper-grey-200': '#eeeeee',
299 | 'paper-grey-300': '#e0e0e0',
300 | 'paper-grey-400': '#bdbdbd',
301 | 'paper-grey-500': '#9e9e9e',
302 | 'paper-grey-600': '#757575',
303 | 'paper-grey-700': '#616161',
304 | 'paper-grey-800': '#424242',
305 | 'paper-grey-900': '#212121',
306 |
307 | 'paper-blue-grey-50': '#eceff1',
308 | 'paper-blue-grey-100': '#cfd8dc',
309 | 'paper-blue-grey-200': '#b0bec5',
310 | 'paper-blue-grey-300': '#90a4ae',
311 | 'paper-blue-grey-400': '#78909c',
312 | 'paper-blue-grey-500': '#607d8b',
313 | 'paper-blue-grey-600': '#546e7a',
314 | 'paper-blue-grey-700': '#455a64',
315 | 'paper-blue-grey-800': '#37474f',
316 | 'paper-blue-grey-900': '#263238',
317 |
318 | /* opacity for dark text on a light background */
319 | 'dark-divider-opacity': '.12',
320 | 'dark-disabled-opacity': '.38', /* or hint text or icon */
321 | 'dark-secondary-opacity': '.54',
322 | 'dark-primary-opacity': '.87',
323 |
324 | /* opacity for light text on a dark background */
325 | 'light-divider-opacity': '.12',
326 | 'light-disabled-opacity': '.3', /* or hint text or icon */
327 | 'light-secondary-opacity': '.7',
328 | 'light-primary-opacity': '1'
329 | };
330 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/drawer.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Drawer */
11 |
12 | .Drawer {
13 | @nest &-content {
14 | @apply(--layout-vertical);
15 | @apply(--paper-font-body2);
16 |
17 | background-color: var(--primary-background-color);
18 | color: var(--primary-text-color);
19 | height: 100%;
20 |
21 | @media (--md-viewport) {
22 | background-color: var(--secondary-background-color);
23 | border-right: 1px solid var(--divider-color);
24 | color: var(--secondary-text-color);
25 | }
26 | }
27 |
28 | @nest &-header {
29 | background-color: var(--primary-background-color);
30 | border-bottom: 1px solid var(--divider-color);
31 | color: var(--primary-text-color);
32 |
33 | @media (--md-viewport) {
34 | background-color: var(--dark-primary-color);
35 | border: 0 !important;
36 | box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
37 | color: var(--text-dark-primary-color);
38 | }
39 | }
40 |
41 | @nest &-link {
42 | color: currentColor;
43 | text-decoration: none;
44 | }
45 |
46 | @nest &-title {
47 | @apply(--paper-font-headline);
48 | }
49 |
50 | @nest &-widget {
51 | padding: 8px 0;
52 |
53 | @nest &--bottom {
54 | border-top: 1px solid var(--divider-color);
55 | }
56 |
57 | @nest &--footer {
58 | @apply(--paper-font-caption);
59 |
60 | border-top: 1px solid var(--divider-color);
61 | padding-left: 24px;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/main.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Main */
11 |
12 | .Main {
13 | background-color: var(--secondary-background-color);
14 |
15 | @nest &-content {
16 | @apply(--paper-font-body1);
17 | color: var(--primary-text-color);
18 |
19 | @media (--md-viewport) {
20 | @apply(--paper-font-body2);
21 | padding: 48px 64px;
22 | }
23 |
24 | @nest & a {
25 | color: var(--accent-color);
26 | font-weight: 500;
27 | text-decoration: none;
28 | }
29 | }
30 |
31 | @nest &-header {
32 | box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
33 | color: var(--text-primary-color);
34 |
35 | /* postcss-bem-linter: ignore */
36 | --paper-toolbar-content: {
37 | padding: 0;
38 | };
39 | }
40 |
41 | @nest &-headerButton {
42 | /* postcss-bem-linter: ignore */
43 | --paper-icon-button-ink-color: var(--text-dark-primary-color);
44 | }
45 |
46 | @nest &-headerTopBar {
47 | @apply(--layout-horizontal);
48 | @apply(--layout-center);
49 |
50 | background-color: var(--dark-primary-color);
51 | bottom: 0;
52 | color: var(--text-dark-primary-color);
53 | left: 0;
54 | padding: 0 16px;
55 | position: absolute;
56 | right: 0;
57 | top: 0;
58 | }
59 |
60 | @nest &-headerMiddleBar {
61 | @apply(--layout-horizontal);
62 | @apply(--layout-end);
63 |
64 | height: 100%;
65 | margin-left: 54px;
66 |
67 | @media (--md-viewport) {
68 | margin-left: 64px;
69 | }
70 | }
71 |
72 | @nest &-headerBottomBar {
73 | @apply(--layout-horizontal);
74 | @apply(--layout-center);
75 |
76 | margin-left: 54px;
77 |
78 | /* Required for main area's paper-scroll-header-panel custom condensing transformation */
79 | transform-origin: left center;
80 |
81 | @media (--md-viewport) {
82 | margin-left: 64px;
83 | }
84 | }
85 |
86 | @nest &-headerTitle {
87 | @apply(--paper-font-headline);
88 | margin: 0;
89 |
90 | /* Required for main area's paper-scroll-header-panel custom condensing transformation */
91 | transform-origin: left center;
92 |
93 | @media (--md-viewport) {
94 | @apply(--paper-font-display1);
95 | }
96 | }
97 |
98 | @nest &-headerSubTitle {
99 | @apply(--paper-font-subhead);
100 |
101 | /* Required for main area's paper-scroll-header-panel custom condensing transformation */
102 | transform-origin: left center;
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/navigation.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Navigation */
11 |
12 | .Navigation {
13 | padding-bottom: 0;
14 | padding-top: 0;
15 |
16 | @nest &-icon {
17 | margin-right: 24px;
18 | pointer-events: none;
19 | }
20 |
21 | @nest &-link {
22 | @apply(--layout-horizontal);
23 | @apply(--layout-center);
24 |
25 | color: currentColor;
26 | min-height: 48px;
27 | padding-left: 24px;
28 | padding-right: 24px;
29 | text-decoration: none;
30 | }
31 |
32 | @nest &-text {
33 | pointer-events: none;
34 | }
35 | }
36 |
37 | /* https://github.com/jonathantneal/postcss-nesting/issues/16 */
38 | .Navigation--menu {
39 | --paper-menu-color: currentColor;
40 |
41 | /* stylelint-disable indentation */
42 |
43 | /* postcss-bem-linter: ignore */
44 | --paper-menu-selected-item: {
45 | color: var(--accent-color);
46 | };
47 |
48 | /* postcss-bem-linter: ignore */
49 | --paper-menu-focused-item-after: {
50 | background-color: var(--disabled-text-color);
51 | };
52 | /* stylelint-enable */
53 |
54 | @media (--md-viewport) {
55 | background-color: var(--secondary-background-color);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/page.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Page */
11 |
12 | .Page {
13 | @nest &-formInput {
14 | --paper-input-container-focus-color: var(--accent-color);
15 |
16 | width: 250px;
17 | }
18 |
19 | @nest &:focus {
20 | outline: none;
21 | }
22 |
23 | @nest &-title {
24 | @apply(--paper-font-display1);
25 |
26 | margin: 32px 0;
27 |
28 | @media (--sm-viewport) {
29 | font-size: 24px;
30 | margin: 16px 0;
31 | }
32 | }
33 |
34 | @nest &-subTitle {
35 | @apply(--paper-font-subhead);
36 | }
37 |
38 | @nest &-paper {
39 | background-color: var(--primary-background-color);
40 | border-radius: 2px;
41 | height: 100%;
42 | margin-bottom: 16px;
43 | padding: 16px;
44 |
45 | @media (--md-viewport) {
46 | margin-bottom: 32px;
47 | padding: 16px 32px;
48 | }
49 |
50 | @nest &--settings {
51 | @apply(--layout-vertical);
52 | @apply(--layout-center);
53 | }
54 | }
55 |
56 | @nest &-widget {
57 | width: 100%;
58 |
59 | @media (--md-viewport) {
60 | width: 512px;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/skeleton.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Skeleton */
11 |
12 | .Skeleton {
13 | @nest & * {
14 | box-sizing: border-box;
15 | }
16 |
17 | @nest &-drawer {
18 | background-color: var(--secondary-background-color);
19 | bottom: 0;
20 | display: none;
21 | left: 0;
22 | position: fixed;
23 | right: auto;
24 | top: 0;
25 | width: 0;
26 |
27 | @media (--md-viewport) {
28 | display: block;
29 | width: 256px;
30 | }
31 | }
32 |
33 | @nest &-drawerContent {
34 | border-right: 1px solid var(--divider-color);
35 | height: 100%;
36 | }
37 |
38 | @nest &-drawerHeader {
39 | background-color: var(--dark-primary-color);
40 | box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
41 | color: var(--text-dark-primary-color);
42 | display: block;
43 | height: 64px;
44 | }
45 |
46 | @nest &-drawerHeaderContent {
47 | align-items: center;
48 | display: flex;
49 | flex-direction: row;
50 | height: 64px;
51 | margin: 0 16px;
52 | }
53 |
54 | @nest &-drawerTitle {
55 | /* Nested mixins issue https://github.com/pascalduez/postcss-apply/issues/3
56 | @apply rule with brackets issue https://github.com/pascalduez/postcss-apply/issues/4
57 | */
58 | @apply --paper-font-common-base;
59 | @apply --paper-font-headline;
60 | }
61 |
62 | @nest &-main {
63 | background-color: var(--secondary-background-color);
64 | bottom: 0;
65 | left: 0;
66 | overflow: hidden;
67 | position: fixed;
68 | right: 0;
69 | top: 0;
70 |
71 | @media (--md-viewport) {
72 | left: 256px;
73 | }
74 | }
75 |
76 | @nest &-mainHeader {
77 | background-color: var(--primary-color);
78 | box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
79 | height: calc(56px * 3);
80 | left: 0;
81 | position: relative;
82 | right: 0;
83 | top: 0;
84 |
85 | @media (--md-viewport) {
86 | height: calc(64px * 3);
87 | }
88 | }
89 |
90 | @nest &-mainHeaderTopBar {
91 | background-color: var(--dark-primary-color);
92 | height: 56px;
93 |
94 | @media (--md-viewport) {
95 | height: 64px;
96 | }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/swatch-picker.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define SwatchPicker */
11 |
12 | .SwatchPicker {
13 | @apply(--layout-horizontal);
14 | @apply(--layout-center);
15 |
16 | min-height: 48px;
17 |
18 | @nest &-button {
19 | --paper-swatch-picker-color-size: 48px;
20 | --paper-icon-button-ink-color: var(--accent-color);
21 |
22 | color: var(--accent-color);
23 | }
24 |
25 | @nest &-icon {
26 | margin-right: 24px;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/toast.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Toast */
11 |
12 | /* https://www.google.com/design/spec/components/snackbars-toasts.html#snackbars-toasts-specs */
13 |
14 | .Toast {
15 | @apply(--paper-font-body1);
16 |
17 | @nest &-button {
18 | @apply(--paper-font-button);
19 |
20 | color: var(--accent-color);
21 | margin-left: 24px;
22 |
23 | @media(--md-viewport) {
24 | margin-left: 48px;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/themes/default-theme/components/toggle.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /** @define Toggle */
11 |
12 | /* https://www.google.com/design/spec/components/selection-controls.html#selection-controls-switch */
13 |
14 | .Toggle {
15 | @apply(--layout-horizontal);
16 | @apply(--layout-center);
17 |
18 | min-height: 48px;
19 |
20 | @nest &-button {
21 | --paper-toggle-button-unchecked-bar-color: var(--toggle-unchecked-bar-color);
22 | --paper-toggle-button-unchecked-button-color: var(--toggle-unchecked-button-color);
23 | --paper-toggle-button-unchecked-ink-color: var(--toggle-unchecked-ink-color);
24 | --paper-toggle-button-checked-bar-color: var(--toggle-checked-bar-color);
25 | --paper-toggle-button-checked-button-color: var(--toggle-checked-button-color);
26 | --paper-toggle-button-checked-ink-color: var(--toggle-checked-ink-color);
27 | }
28 |
29 | @nest &-icon {
30 | margin-right: 24px;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/themes/default-theme/fonts.list:
--------------------------------------------------------------------------------
1 | Roboto:500&subset=latin
2 |
--------------------------------------------------------------------------------
/app/themes/default-theme/icons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
27 |
28 |
--------------------------------------------------------------------------------
/app/themes/default-theme/mixins.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
--------------------------------------------------------------------------------
/app/themes/default-theme/theme.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | @import 'variables';
11 | @import 'breakpoints';
12 | @import 'mixins';
13 |
14 | /* Components */
15 | @import 'components/drawer';
16 | @import 'components/main';
17 | @import 'components/navigation';
18 | @import 'components/swatch-picker';
19 | @import 'components/toast';
20 | @import 'components/toggle';
21 |
22 | /* Utilities */
23 | @import 'utilities/display';
24 | @import 'utilities/layout';
25 |
--------------------------------------------------------------------------------
/app/themes/default-theme/theme.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
29 |
37 |
--------------------------------------------------------------------------------
/app/themes/default-theme/typography.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /*
11 | Typography mixins are from file on URL https://github.com/PolymerElements/paper-styles/blob/master/typography.html
12 | */
13 |
14 | :root {
15 | /* Shared Styles */
16 | --paper-font-common-base: {
17 | font-family: 'Roboto', 'Noto', sans-serif;
18 | -webkit-font-smoothing: antialiased;
19 | };
20 |
21 | --paper-font-common-code: {
22 | font-family: 'Roboto Mono', 'Consolas', 'Menlo', monospace;
23 | -webkit-font-smoothing: antialiased;
24 | };
25 |
26 | --paper-font-common-expensive-kerning: {
27 | text-rendering: optimizeLegibility;
28 | };
29 |
30 | --paper-font-common-nowrap: {
31 | white-space: nowrap;
32 | overflow: hidden;
33 | text-overflow: ellipsis;
34 | };
35 |
36 | /* Material Font Styles */
37 |
38 | --paper-font-display4: {
39 | @apply(--paper-font-common-base);
40 | @apply(--paper-font-common-nowrap);
41 |
42 | font-size: 112px;
43 | font-weight: 300;
44 | letter-spacing: -0.044em;
45 | line-height: 120px;
46 | };
47 |
48 | --paper-font-display3: {
49 | @apply(--paper-font-common-base);
50 | @apply(--paper-font-common-nowrap);
51 |
52 | font-size: 56px;
53 | font-weight: 400;
54 | letter-spacing: -0.026em;
55 | line-height: 60px;
56 | };
57 |
58 | --paper-font-display2: {
59 | @apply(--paper-font-common-base);
60 |
61 | font-size: 45px;
62 | font-weight: 400;
63 | letter-spacing: -0.018em;
64 | line-height: 48px;
65 | };
66 |
67 | --paper-font-display1: {
68 | @apply(--paper-font-common-base);
69 |
70 | font-size: 34px;
71 | font-weight: 400;
72 | letter-spacing: -0.01em;
73 | line-height: 40px;
74 | };
75 |
76 | --paper-font-headline: {
77 | @apply(--paper-font-common-base);
78 |
79 | font-size: 24px;
80 | font-weight: 400;
81 | letter-spacing: -0.012em;
82 | line-height: 32px;
83 | };
84 |
85 | --paper-font-title: {
86 | @apply(--paper-font-common-base);
87 | @apply(--paper-font-common-nowrap);
88 |
89 | font-size: 20px;
90 | font-weight: 500;
91 | line-height: 28px;
92 | };
93 |
94 | --paper-font-subhead: {
95 | @apply(--paper-font-common-base);
96 |
97 | font-size: 16px;
98 | font-weight: 400;
99 | line-height: 24px;
100 | };
101 |
102 | --paper-font-body2: {
103 | @apply(--paper-font-common-base);
104 |
105 | font-size: 14px;
106 | font-weight: 500;
107 | line-height: 24px;
108 | };
109 |
110 | --paper-font-body1: {
111 | @apply(--paper-font-common-base);
112 |
113 | font-size: 14px;
114 | font-weight: 400;
115 | line-height: 20px;
116 | };
117 |
118 | --paper-font-caption: {
119 | @apply(--paper-font-common-base);
120 | @apply(--paper-font-common-nowrap);
121 |
122 | font-size: 12px;
123 | font-weight: 400;
124 | letter-spacing: 0.011em;
125 | line-height: 20px;
126 | };
127 |
128 | --paper-font-menu: {
129 | @apply(--paper-font-common-base);
130 | @apply(--paper-font-common-nowrap);
131 |
132 | font-size: 13px;
133 | font-weight: 500;
134 | line-height: 24px;
135 | };
136 |
137 | --paper-font-button: {
138 | @apply(--paper-font-common-base);
139 | @apply(--paper-font-common-nowrap);
140 |
141 | font-size: 14px;
142 | font-weight: 500;
143 | letter-spacing: 0.018em;
144 | line-height: 24px;
145 | text-transform: uppercase;
146 | };
147 |
148 | --paper-font-code2: {
149 | @apply(--paper-font-common-code);
150 |
151 | font-size: 14px;
152 | font-weight: 700;
153 | line-height: 20px;
154 | };
155 |
156 | --paper-font-code1: {
157 | @apply(--paper-font-common-code);
158 |
159 | font-size: 14px;
160 | font-weight: 500;
161 | line-height: 20px;
162 | };
163 | }
164 |
--------------------------------------------------------------------------------
/app/themes/default-theme/utilities/display.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /*
11 | This class is used when we manage the focus start point (like when a new page
12 | is loaded). We typically move the focus start point to the first header in the
13 | page and don't want a focus ring to display. Instead the next time the user
14 | presses tab the focus ring will appear on the nearest, focusable element.
15 | */
16 | .u-focusTarget {
17 | outline: none;
18 | }
--------------------------------------------------------------------------------
/app/themes/default-theme/utilities/layout.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | .u-spacer {
11 | @apply(--layout-flex);
12 | }
13 |
--------------------------------------------------------------------------------
/app/themes/default-theme/variables.css:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | /*
11 | Polymer includes a shim for CSS Custom Properties that we can use for application theming.
12 | Below, you'll find the default palette for the Polymer Starter Kit Plus layout. Feel free to play
13 | with changing the colors used or generate your own palette of colours at MaterialPalette.com.
14 |
15 | See https://www.polymer-project.org/1.0/docs/devguide/styling.html#xscope-styling-details
16 | for further information on custom CSS properties.
17 | */
18 |
19 | /* Material Design Style
20 | http://www.google.com/design/spec/style/color.html */
21 |
22 | :root {
23 | /* Material Design Themes
24 | https://www.google.com/design/spec/style/color.html#color-themes */
25 |
26 | /* Light theme */
27 | --light-theme-primary-background-color: var(--paper-grey-50); /* Content background */
28 | --light-theme-secondary-background-color: var(--paper-grey-100); /* Main / Drawer background */
29 | --light-theme-tertiary-background-color: #fff; /* Cards / Dialogs background */
30 | --light-theme-primary-text-color: rgba(0, 0, 0, 0.87);
31 | --light-theme-secondary-text-color: rgba(0, 0, 0, 0.54); /* Secondary text / Icons */
32 | --light-theme-disabled-text-color: rgba(0, 0, 0, 0.38); /* Disabled / Hint text */
33 | --light-theme-divider-color: rgba(0, 0, 0, 0.12);
34 |
35 | /* Dark theme */
36 | --dark-theme-primary-background-color: #303030; /* Content background */
37 | --dark-theme-secondary-background-color: var(--paper-grey-900); /* Main / Drawer background */
38 | --dark-theme-tertiary-background-color: var(--paper-grey-800); /* Cards / Dialogs background */
39 | --dark-theme-primary-text-color: rgba(255, 255, 255, 0.9);
40 | --dark-theme-secondary-text-color: rgba(255, 255, 255, 0.7); /* Secondary text / Icons */
41 | --dark-theme-disabled-text-color: rgba(255, 255, 255, 0.3); /* Disabled / Hint text */
42 | --dark-theme-divider-color: rgba(255, 255, 255, 0.12);
43 |
44 | /* Colors */
45 | --primary-background-color: var(--$(themeMode)-theme-primary-background-color);
46 | --secondary-background-color: var(--$(themeMode)-theme-secondary-background-color);
47 | --tertiary-background-color: var(--$(themeMode)-theme-tertiary-background-color);
48 | --primary-text-color: var(--$(themeMode)-theme-primary-text-color);
49 | --secondary-text-color: var(--$(themeMode)-theme-secondary-text-color);
50 | --disabled-text-color: var(--$(themeMode)-theme-disabled-text-color);
51 | --divider-color: var(--$(themeMode)-theme-divider-color);
52 | --error-color: var(--paper-deep-orange-a700); /* User input errors */
53 |
54 | /* Primary colors */
55 | --primary-color: var(--paper-$(primaryColorName)-500); /* Header bar */
56 | --light-primary-color: var(--paper-$(primaryColorName)-100);
57 | --dark-primary-color: var(--paper-$(primaryColorName)-700);
58 | --text-primary-color: #fff; /* Text / Icons */
59 | --text-light-primary-color: var(--paper-grey-900);
60 | --text-dark-primary-color: #fff;
61 |
62 | /* Accent colors */
63 | --accent-color: var(--paper-$(accentColorName)-a200); /* Focus / Links / Switches */
64 | --light-accent-color: var(--paper-$(accentColorName)-a100);
65 | --dark-accent-color: var(--paper-$(accentColorName)-a400);
66 | --darker-accent-color: var(--paper-$(accentColorName)-a700);
67 | --text-accent-color: #fff; /* Text / Icons */
68 | --text-light-accent-color: var(--paper-grey-900);
69 | --text-dark-accent-color: #fff;
70 |
71 | /* Toggle button colors
72 | https://www.google.com/design/spec/components/selection-controls.html#selection-controls-switch */
73 | --light-theme-toggle-unchecked-bar-color: #000;
74 | --light-theme-toggle-unchecked-button-color: var(--paper-grey-50);
75 | --light-theme-toggle-unchecked-ink-color: var(--paper-grey-700);
76 | --light-theme-toggle-checked-bar-color: var(--accent-color);
77 | --light-theme-toggle-checked-button-color: var(--accent-color);
78 | --light-theme-toggle-checked-ink-color: var(--dark-accent-color);
79 |
80 | --dark-theme-toggle-unchecked-bar-color: var(--paper-grey-400);
81 | --dark-theme-toggle-unchecked-button-color: var(--paper-grey-400);
82 | --dark-theme-toggle-unchecked-ink-color: var(--paper-grey-50);
83 | --dark-theme-toggle-checked-bar-color: var(--light-accent-color);
84 | --dark-theme-toggle-checked-button-color: var(--light-accent-color);
85 | --dark-theme-toggle-checked-ink-color: var(--light-accent-color);
86 |
87 | --toggle-unchecked-bar-color: var(--$(themeMode)-theme-toggle-unchecked-bar-color);
88 | --toggle-unchecked-button-color: var(--$(themeMode)-theme-toggle-unchecked-button-color);
89 | --toggle-unchecked-ink-color: var(--$(themeMode)-theme-toggle-unchecked-ink-color);
90 | --toggle-checked-bar-color: var(--$(themeMode)-theme-toggle-checked-bar-color);
91 | --toggle-checked-button-color: var(--$(themeMode)-theme-toggle-checked-button-color);
92 | --toggle-checked-ink-color: var(--$(themeMode)-theme-toggle-checked-ink-color);
93 |
94 | /* Deprecated values because of their confusing names.
95 | https://github.com/PolymerElements/paper-styles/blob/master/default-theme.html */
96 | --default-primary-color: var(--primary-color);
97 | }
98 |
--------------------------------------------------------------------------------
/app/themes/default-theme/variables.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | Code distributed by Google as part of the polymer project is also
7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | var primaryColorName = 'indigo',
11 | accentColorName = 'pink',
12 | themeMode = 'light', // or dark
13 |
14 | colors = require('./colors'),
15 | primaryColor = colors['paper-' + primaryColorName + '-500'],
16 | darkPrimaryColor = colors['paper-' + primaryColorName + '-700'];
17 |
18 | module.exports = {
19 | global: {
20 | primaryColorName: primaryColorName,
21 | accentColorName: accentColorName,
22 | themeMode: themeMode
23 | },
24 |
25 | // Web Application Manifest - manifest.json
26 | manifest: {
27 | 'theme_color': darkPrimaryColor,
28 | 'background_color': primaryColor
29 | },
30 |
31 | // HTML Metadata in head of index.html
32 | metadata: {
33 | // Chrome for Android theme color
34 | chromeThemeColor: darkPrimaryColor,
35 | // Tile color for Win8
36 | msapplicationTileColor: primaryColor
37 | }
38 | };
39 |
--------------------------------------------------------------------------------
/app/views/head.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | {$ title $}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
50 |
51 |
52 |
53 |
56 |
57 |
--------------------------------------------------------------------------------
/app/views/skeleton.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
{$ title $}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "polymer-starter-kit-plus",
3 | "private": true,
4 | "dependencies": {
5 | "font-roboto": "StartPolymer/font-empty#1.1.0",
6 | "iron-flex-layout": "PolymerElements/iron-flex-layout#1.2.3",
7 | "iron-localstorage": "PolymerElements/iron-localstorage#1.0.5",
8 | "iron-pages": "PolymerElements/iron-pages#1.0.7",
9 | "iron-selector": "PolymerElements/iron-selector#1.2.2",
10 | "page": "visionmedia/page.js#1.6.4",
11 | "paper-drawer-panel": "PolymerElements/paper-drawer-panel#1.0.6",
12 | "paper-icon-button": "PolymerElements/paper-icon-button#1.0.6",
13 | "paper-input": "PolymerElements/paper-input#1.1.6",
14 | "paper-item": "PolymerElements/paper-item#1.1.3",
15 | "paper-material": "PolymerElements/paper-material#1.0.6",
16 | "paper-menu": "PolymerElements/paper-menu#1.2.2",
17 | "paper-scroll-header-panel": "PolymerElements/paper-scroll-header-panel#1.0.15",
18 | "paper-styles": "PolymerElements/paper-styles#1.1.3",
19 | "paper-swatch-picker": "PolymerElements/paper-swatch-picker#master",
20 | "paper-toast": "PolymerElements/paper-toast#1.1.3",
21 | "paper-toggle-button": "PolymerElements/paper-toggle-button#1.1.1",
22 | "paper-toolbar": "PolymerElements/paper-toolbar#1.1.4",
23 | "platinum-sw": "PolymerElements/platinum-sw#1.2.3",
24 | "polymer": "Polymer/polymer#1.3.0",
25 | "start-google-analytics-tracker": "StartPolymer/start-google-analytics-tracker#1.1.0"
26 | },
27 | "devDependencies": {
28 | "web-component-tester": "4.2.0"
29 | },
30 | "ignore": []
31 | }
32 |
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | var execSync = require('child_process').execSync,
2 | appVersion = null;
3 |
4 | try {
5 | appVersion = execSync('git describe --tags').toString().replace(/(\r\n|\n|\r)/gm, '');
6 | } catch(e) {
7 | console.log('Warning: Can\'t run "git describe" for determine app version');
8 | }
9 |
10 | module.exports = {
11 | // App name ID is used for iron-localstorage element and Service Worker cache ID
12 | appNameId: 'polymer-starter-kit-plus',
13 | // App theme is directory name in app/themes
14 | appTheme: 'default-theme',
15 | // App version from git is used for deploy task and frontend
16 | appVersion: appVersion,
17 | // Autoprefixer
18 | autoprefixer: {
19 | // https://github.com/postcss/autoprefixer#browsers
20 | browsers: [
21 | // Setup for WebComponents Browser Support
22 | // https://github.com/WebComponents/webcomponentsjs#browser-support
23 | 'Explorer >= 10',
24 | 'ExplorerMobile >= 10',
25 | 'Firefox >= 30',
26 | 'Chrome >= 34',
27 | 'Safari >= 7',
28 | 'Opera >= 23',
29 | 'iOS >= 7',
30 | 'Android >= 4.4',
31 | 'BlackBerry >= 10'
32 | ]
33 | },
34 | // BrowserSync
35 | browserSync: {
36 | browser: 'default', // or ["google chrome", "firefox"]
37 | https: false, // Enable https for localhost development.
38 | notify: false, // The small pop-over notifications in the browser.
39 | port: process.env.PORT || 3000, // Environment variable $PORT is for Cloud9 IDE
40 | ui: {
41 | port: 3001
42 | }
43 | },
44 | // Deploy task
45 | deploy: {
46 | // Choose hosting
47 | hosting: 'gae', // or firebase, gcs, ssh
48 | // Firebase
49 | // Firebase requires Firebase Command Line Tools to be installed and configured.
50 | // For info on tool: https://www.firebase.com/docs/hosting/command-line-tool.html
51 | firebase: {
52 | env: {
53 | development: 'polymer-starter-kit-plus-dev', // subdomain
54 | staging: 'polymer-starter-kit-plus-staging',
55 | production: 'polymer-starter-kit-plus'
56 | }
57 | },
58 | // Google App Engine
59 | // GAE requires Google Cloud SDK to be installed and configured.
60 | // For info on SDK: https://cloud.google.com/sdk/
61 | gae: {
62 | env: {
63 | development: 'polymer-starter-kit-plus-dev', // project ID
64 | staging: 'polymer-starter-kit-plus-staging',
65 | production: 'polymer-starter-kit-plus'
66 | },
67 | // Promote the deployed version to receive all traffic.
68 | // https://cloud.google.com/sdk/gcloud/reference/preview/app/deploy
69 | promote: true
70 | },
71 | // Google Cloud Storage
72 | // GCS requires Google Cloud SDK with gsutil to be installed and configured.
73 | // For info on SDK: https://cloud.google.com/sdk/
74 | gcs: {
75 | acl: { // https://cloud.google.com/storage/docs/access-control
76 | development: 'public-read',
77 | staging: 'public-read',
78 | production: 'public-read'
79 | },
80 | env: { // https://cloud.google.com/storage/docs/reference-uris
81 | development: 'dev.example.com', // bucket
82 | staging: 'staging.example.com',
83 | production: 'www.example.com'
84 | },
85 | cacheTTL: {
86 | development: '0',
87 | staging: '0',
88 | production: '315360000', // 10 years
89 | productionNoCache: '300' // 5 min for files without revision hash
90 | }
91 | },
92 | // Any Linux hosting with SSH
93 | // Install your SSH public key ~/.ssh/id_rsa.pub onto a remote Linux
94 | // Example command: ssh-copy-id root@server.example.com
95 | ssh: {
96 | env: {
97 | development: '/path/to/remote-dir-dev', // remote dir must not exist
98 | staging: '/path/to/remote-dir-staging',
99 | production: '/path/to/remote-dir'
100 | },
101 | host: 'server.example.com',
102 | port: 22,
103 | user: 'root'
104 | }
105 | },
106 | // PageSpeed Insights
107 | // Please feel free to use the `nokey` option to try out PageSpeed
108 | // Insights as part of your build process. For more frequent use,
109 | // we recommend registering for your own API key. For more info:
110 | // https://developers.google.com/speed/docs/insights/v1/getting_started
111 | pageSpeed: {
112 | key: '', // need uncomment in task
113 | nokey: true,
114 | site: 'https://polymer-starter-kit-plus.firebaseapp.com',
115 | strategy: 'mobile' // or desktop
116 | },
117 | // Service Worker
118 | serviceWorker: {
119 | cacheDisabled: false
120 | }
121 | };
122 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Recipes
2 |
3 | * [Add ES2015 (formally ES6) support using Babel](add-es2015-support-babel.md)
4 | * [Polymer Performance Recipe](polymer-perf.md)
5 | * [Use PSK with Chrome Dev Editor](chrome-dev-editor.md)
6 | * [Deploy to Github Pages](deploy-to-github-pages.md)
7 | * [Deploy to Firebase using Pretty URLs](deploy-to-firebase-pretty-urls.md)
8 | * [Deploy to Google App Engine](deploy-to-google-app-engine.md)
9 | * [Use PSK for Mobile Chrome Apps](mobile-chrome-apps.md)
10 | * [Add page transitions with neon-animated-pages](neon-animated-pages.md)
11 | * [Add ESLint support](add-eslint-support.md)
12 |
--------------------------------------------------------------------------------
/docs/add-es2015-support-babel.md:
--------------------------------------------------------------------------------
1 | # Add ES2015 support through Babel
2 |
3 | Although support for ES2015 (formerly ES6) is improving in modern browsers, the majority do not yet support the full set of features. To benefit from the awesomeness of the new ES2015 syntax while keeping backwards compatibility with Polymer's supported browsers, you'll need to transpile your JS code from ES2015 to ES5
4 |
5 | This recipe focuses on adding an ES2015 to ES5 transpile step to Polymer Starter Kit's build pipeline using [BabelJS](https://babeljs.io/).
6 |
7 |
8 | ## Create a transpile gulp task
9 |
10 | - Install the gulp Babel, Sourcemap, Crisper plugins and Babel ES2015 preset: `npm install --save-dev gulp-babel gulp-sourcemaps gulp-crisper babel-preset-es2015`
11 | - Add the following gulp task in the `gulpfile.js` file:
12 |
13 | ```patch
14 | + // Transpile all JS to ES5.
15 | + gulp.task('js', function() {
16 | + return gulp.src(['app/**/*.{js,html}', '!app/bower_components/**/*'])
17 | + .pipe($.sourcemaps.init())
18 | + .pipe($.if('*.html', $.crisper({scriptInHead: false}))) // Extract JS from .html files
19 | + .pipe($.if('*.js', $.babel({
20 | + presets: ['es2015']
21 | + })))
22 | + .pipe($.sourcemaps.write('.'))
23 | + .pipe(gulp.dest('.tmp/'))
24 | + .pipe(gulp.dest(dist()));
25 | + });
26 | ```
27 |
28 | This task will transpile all JS files and inline JS inside HTML files and also generate sourcemaps. The resulting files are generated in the `.tmp` and the `dist` folders
29 |
30 | [Crisper](https://github.com/PolymerLabs/crisper) extracts JavaScript that's inline to HTML files (such as imports). We need this as Babel does not support transpiling HTML files such as `
149 | ```
150 |
--------------------------------------------------------------------------------
/docs/add-eslint-support.md:
--------------------------------------------------------------------------------
1 | # Add ESLint support
2 |
3 | This recipe helps you to create a task to use [ESLint](http://eslint.org/) tool.
4 |
5 |
6 | ## Create .eslintrc.json file in the root folder
7 |
8 | ```
9 | {
10 | "extends": "eslint:recommended",
11 | "rules": {
12 | "no-console": 0
13 | },
14 | "env": {
15 | "browser": true
16 | },
17 | "plugins": [
18 | "html"
19 | ],
20 | "globals": {
21 | "__dirname": false,
22 | "app": false,
23 | "page": false,
24 | "Polymer": false,
25 | "process": false,
26 | "require": false
27 | }
28 | }
29 | ```
30 |
31 | ## Create .eslintignore file in the root folder
32 |
33 | ```
34 | /app/bower_components/**
35 | /dist/**
36 | ```
37 |
38 |
39 | ## Create a lint gulp task
40 |
41 | - Install the gulp-eslint and eslint-plugin-html: `npm install --save-dev gulp-eslint eslint-plugin-html`
42 | - Add the following gulp task in the `gulpfile.js` file:
43 |
44 | ```patch
45 |
46 | + // Lint JavaScript
47 | + gulp.task('lint', function() {
48 | + return gulp.src([
49 | + 'app/scripts/**/*.js',
50 | + 'app/elements/**/*.html',
51 | + 'gulpfile.js'
52 | + ])
53 | + .pipe(reload({
54 | + stream: true,
55 | + once: true
56 | + }))
57 | + .pipe($.eslint())
58 | + .pipe($.eslint.format())
59 | + .pipe($.eslint.failAfterError());
60 | + });
61 | ```
62 |
63 | This task will check all JS files and JS inside HTML files.
64 |
65 |
66 | ## Integrating the lint task
67 |
68 | Make sure the `lint` gulp task is triggered by the common build tasks:
69 |
70 | - In the gulp `serve` task, make sure `lint` is triggered initially and on HTML and JS files changes:
71 |
72 | ```patch
73 | -gulp.task('serve', ['styles'], function () {
74 | +gulp.task('serve', ['lint', 'styles'], function () {
75 |
76 | ...
77 |
78 | gulp.watch(['app/**/*.html', '!app/bower_components/**/*.html'], reload);
79 | gulp.watch(['app/styles/**/*.css'], ['styles', reload]);
80 | + gulp.watch(['app/{scripts,elements}/**/{*.js,*.html}'], ['lint', reload]);
81 | gulp.watch(['app/images/**/*'], reload);
82 | });
83 | ```
84 |
85 | - In the `default` task make sure `lint` is run in parallel to `images`, `fonts` and `html`:
86 |
87 | ```patch
88 | gulp.task('default', ['clean'], function (cb) {
89 |
90 | ...
91 |
92 | runSequence(
93 | ['copy', 'styles'],
94 | - ['images', 'fonts', 'html'],
95 | + ['lint', 'images', 'fonts', 'html'],
96 | 'vulcanize', // 'cache-config',
97 | cb);
98 | });
99 | ```
100 |
101 |
--------------------------------------------------------------------------------
/docs/chrome-dev-editor.md:
--------------------------------------------------------------------------------
1 | # Use Polymer Starter Kit on Chrome Dev Editor
2 |
3 | If you are using a Chromebook, one of the few IDE you can use is [Chrome Dev Editor](https://github.com/GoogleChrome/chromedeveditor).
4 |
5 | To use the Polymer Starter Kit you have to download the [latest release](https://github.com/PolymerElements/polymer-starter-kit/releases) in the `light` flavor (the additional tools can't be used from CDE).
6 |
7 | After downloading the `polymer-starter-kit-light-*.zip` file unpack it in a new folder (for Example `psk-light`) you should have a directory structure like
8 |
9 | 
10 |
11 | When the app first opens you'll notice, in the bottom left, that Bower is updating.
12 |
13 | 
14 |
15 | Wait for this process to finish before continuing (it may take a few minutes). When it is complete, you should notice that the `bower_components` directory has moved to `app/bower_components`. This is because CDE is respecting the configuration in our `.bowerrc` file. This is a good thing :)
16 |
17 | We can now `Open Folder...` inside CDE and start renaming the file `app/manifest.json` to `app/web-app-manifest.json`, followed by updating the link to it in the file `app/index.html`
18 |
19 | 
20 |
21 |
22 | *This change is needed because `manifest.json` is interpreted by CDE as a [Chrome Apps Manifest](https://developer.chrome.com/extensions/manifest) and the [web app manifest](https://w3c.github.io/manifest/) is slightly different*
23 |
24 | Open `app/elements/routing.html` and add the following code after the last route:
25 |
26 | ```javascript
27 | page('*', function () {
28 | app.route = 'home';
29 | });
30 | ```
31 |
32 | After the change, the code will look like the following:
33 |
34 | ```javascript
35 | ...
36 | page('/contact', function () {
37 | app.route = 'contact';
38 | });
39 |
40 | page('*', function () {
41 | app.route = 'home';
42 | });
43 |
44 | // add #! before urls
45 | page({
46 | hashbang: true
47 | });
48 | ...
49 | ```
50 |
51 |
52 | Select `app/index.html` and hit run (or press CTRL+R) to see the application running in the browser.
53 |
--------------------------------------------------------------------------------
/docs/deploy-to-firebase-pretty-urls.md:
--------------------------------------------------------------------------------
1 | # Deploy to Firebase using Pretty URLs
2 |
3 | Firebase is a very simple and secure way to deploy a Polymer Starter Kit site. You can sign up for a free account and deploy your application in less than 5 minutes.
4 |
5 | The instructions below are based on the [Firebase hosting quick start
6 | guide](https://www.firebase.com/docs/hosting/quickstart.html).
7 |
8 | 1. [Sign up for a Firebase account](https://www.firebase.com/signup/)
9 |
10 | 1. Install the Firebase command line tools
11 |
12 | npm install -g firebase-tools
13 |
14 | The `-g` flag instructs `npm` to install the package globally so that you
15 | can use the `firebase` command from any directory. You may need
16 | to install the package with `sudo` privileges.
17 |
18 | 1. `cd` into your project directory
19 |
20 | 1. Inititalize the Firebase application
21 |
22 | firebase init
23 |
24 | Firebase asks you which app you would like to use for hosting. If you just
25 | signed up, you should see one app with a randomly-generated name. You can
26 | use that one. Otherwise go to
27 | [https://www.firebase.com/account](https://www.firebase.com/account) to
28 | create a new app.
29 |
30 | 1. Firebase asks you the name of your app's public directory. Enter `dist`.
31 | This works because when you run `gulp` to build your application, PSK
32 | builds everything and places it all in `dist`. So `dist` contains
33 | everything your application needs to run.
34 |
35 | 1. Edit firebase.json, change firebase name, and add `rewrites` section ([see example firebase.json](/docs/firebase.json)).
36 |
37 | {
38 | "firebase": "polymer-starter-kit",
39 | "public": "dist",
40 | "ignore": [
41 | "firebase.json",
42 | "**/.*",
43 | "**/node_modules/**"
44 | ],
45 | "rewrites": [ {
46 | "source": "**",
47 | "destination": "/index.html"
48 | } ]
49 | }
50 |
51 | 1. Add `` to `head` near top of index.html, above ````
52 |
53 | 1. Remove `hashbang: true` in routing.html near bottom. The call to `page` should look like this now:
54 |
55 | page();
56 |
57 | 1. Build
58 |
59 | gulp
60 |
61 | 1. Deploy
62 |
63 | firebase deploy
64 |
65 | The URL to your live site is listed in the output.
66 |
67 | You can see a demo of Polymer Starter Kit hosted on Firebase using pretty URLs at https://polymer-starter-kit.firebaseapp.com.
68 |
--------------------------------------------------------------------------------
/docs/deploy-to-github-pages.md:
--------------------------------------------------------------------------------
1 | # Deploy to Github Pages
2 |
3 | You can deploy to github pages with a couple minor changes to Polymer Starter Kit:
4 |
5 | 1. Uncomment this line `// app.baseUrl = '/polymer-starter-kit/';` in app.js near the top
6 |
7 | ```JavaScript
8 | // Sets app default base URL
9 | app.baseUrl = '/';
10 | if (window.location.port === '') { // if production
11 | // Uncomment app.baseURL below and
12 | // set app.baseURL to '/your-pathname/' if running from folder in production
13 | // app.baseUrl = '/polymer-starter-kit/';
14 | }
15 | ```
16 |
17 | 2. Change `app.baseUrl = '/polymer-starter-kit/';` to `app.baseUrl = '/your-pathname/';` (ex: if you repo is `github.com/username/bobs-awesome-site` you would change this to `app.baseUrl = '/bobs-awesome-site/';`)
18 |
19 | 3. Add this code at the top of `` tag in the [index.html](../app/index.html) to force HTTPS:
20 |
21 | ```html
22 |
23 | ```
24 |
25 | 4. Run `gulp build-deploy-gh-pages` from command line
26 |
27 | 5. To see changes wait 1-2 minutes then load Github pages for your app (ex: https://polymerelements.github.io/polymer-starter-kit)
28 |
29 | ### Notes
30 |
31 | * When deploying to Github Pages we recommend using hashbangs which is Polymer Starter Kit default.
32 | * This method should work for most hosting providers when using a subfolder.
33 |
--------------------------------------------------------------------------------
/docs/deploy-to-google-app-engine.md:
--------------------------------------------------------------------------------
1 | # Deploy to Google App Engine
2 |
3 | Google App Engine is a great way to host your Polymer application using Google infrastructure.
4 |
5 | [You can sign up for a Google Cloud Platform free account](https://cloud.google.com/).
6 |
7 | There are multiple ways to host web app on GCP, but my favorite one is using GAE.
8 |
9 | The scripts below are based on the [Using Static Files guide](https://cloud.google.com/appengine/docs/python/gettingstartedpython27/staticfiles) and [Polymer Gmail by @ebidel](https://github.com/ebidel/polymer-gmail) repository.
10 |
11 | 1. Install the gcloud command line tools
12 |
13 | curl https://sdk.cloud.google.com | bash
14 |
15 | Detailed instructions can be found [here](https://cloud.google.com/sdk/)
16 |
17 | 1. Inititalize gcloud
18 |
19 | gcloud init
20 |
21 | In this step you will be asked to login to your GCP account and set default settings, such as project, zone & region, etc.
22 |
23 | 1. Create a new GCP project using the [Developers Console](https://console.developers.google.com/home/dashboard)
24 |
25 | 1. Add `app.yaml` to your project root folder
26 |
27 | ```yaml
28 | runtime: python27
29 | api_version: 1
30 | threadsafe: yes
31 |
32 | handlers:
33 |
34 | - url: /bower_components
35 | static_dir: bower_components
36 | secure: always
37 |
38 | - url: /images
39 | static_dir: images
40 | secure: always
41 |
42 | - url: /(.*).(html|js|json|css)
43 | static_files: \1.\2
44 | upload: (.*)\.(html|js|json|css)
45 | secure: always
46 |
47 | - url: /
48 | static_files: index.html
49 | upload: index\.html
50 | http_headers:
51 | Link: '; rel=preload; as=script, ; rel=preload; as=document, ; rel=preload; as=style'
52 | # Access-Control-Allow-Origin: "*"
53 | secure: always
54 |
55 | skip_files:
56 | - ^(.*/)?app\.yaml
57 | ```
58 |
59 | This is the configuration file for the GCP project.
60 | It sets a python runtime environment and static file handlers.
61 | The configuration utilizes GAE HTTP/2 capabilities in order to minimize load time for HTTP/2 compatible browsers.
62 |
63 | **Please note**: This also ensures HTTPS; if you wish to use custom domains supporting HTTP only, you will need to remove all the 'secure: always’ entries. If you decide to have custom domains that only use HTTP instead of HTTPS, be aware some Web platform APIs such as service workers and Web app manifests, including some elements that depend on such APIs for their functionality, only work with HTTPS.
64 |
65 | 1. Add a bash script to build & deploy the application
66 |
67 | ```sh
68 | #!/usr/bin/env bash
69 |
70 | GAE_PROJECT=psk
71 | DEPLOY_VERSION=$1
72 |
73 | if [ -z "$DEPLOY_VERSION" ]
74 | then
75 | TAG=`git describe --abbrev=0`
76 | # GAE doesn't allow periods
77 | DEPLOY_VERSION=${TAG//.}
78 | fi
79 |
80 | # Build it.
81 | echo "Building $DEPLOY_VERSION"
82 | gulp
83 | cp app.yaml dist/app.yaml
84 |
85 | echo "Deploying $DEPLOY_VERSION"
86 | gcloud preview app deploy dist/app.yaml --project $GAE_PROJECT --promote --version $DEPLOY_VERSION
87 | ```
88 |
89 | You have to set `GAE_PROJECT` variable to your GAE project id.
90 | A deploy version can be provided as a parameter for the script, if not provided the latest git tag will be used.
91 |
92 | 1. Add execution permission to the script
93 |
94 | chmod +x deploy.sh
95 |
96 | 1. Run the deploy script
97 |
98 | Without version argument in order to use the latest git tag
99 |
100 | ./deploy.sh
101 |
102 | Or with a version argument (according to GAE version [limitations](https://cloud.google.com/appengine/docs/python/config/appconfig?hl=en))
103 |
104 | ./deploy.sh v100
105 |
106 | The URL to your live site is listed in the output.
107 |
108 | Enjoy!
109 |
--------------------------------------------------------------------------------
/docs/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "firebase": "polymer-starter-kit",
3 | "public": "dist",
4 | "ignore": [
5 | "firebase.json",
6 | "**/.*",
7 | "**/node_modules/**"
8 | ],
9 | "rewrites": [ {
10 | "source": "**",
11 | "destination": "/index.html"
12 | } ]
13 | }
14 |
--------------------------------------------------------------------------------
/docs/mobile-chrome-apps.md:
--------------------------------------------------------------------------------
1 | # Use Polymer Starter Kit for [Mobile Chrome Apps](https://github.com/MobileChromeApps/mobile-chrome-apps)
2 |
3 | ## Getting started
4 |
5 | Polymer Starter Kit could be fully adapted to Mobile Chrome Apps through mobile-friendly features. Mobile Chrome Apps, is based on Apache Cordova, and requires mobile application SDKs such as Android and iOS. so please make sure that installation development tool by following [installation guide](https://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/docs/Installation.md) of Mobile Chrome Apps. And then, You do some further steps to resolve some of restrictions and configurations to use Polymer Starter Kit on Cordova. Looking for a [guide video](https://www.youtube.com/watch?v=-ifgyobPLVg) below to better understand.
6 |
7 | [](https://www.youtube.com/watch?v=-ifgyobPLVg)
8 |
9 | ## Download Polymer Starter Kit into your workspace
10 |
11 | To download and preparation, follow this [guide of Polymer Starter Kit](https://github.com/PolymerElements/polymer-starter-kit#getting-started). Make sure that install all of dependencies of npm and Bower.
12 |
13 | ## Create a Cordova project
14 |
15 | Create a Cordova project in path `polymer-starter-kit` by following command. `platform` is the path for Cordova project files, `com.your.app` is the project name/id and next following string is the description for your app.
16 |
17 | ```sh
18 | cca create platform com.your.app "Your Polymer Starter Kit App"
19 | ```
20 |
21 | If you have no problems while creating a project you will seeing the message of installing successful coming from Cordova and have the tree of the project below.
22 |
23 | ```sh
24 | └── polymer-starter-kit
25 | └── app
26 | │ ├── elements
27 | │ ├── images
28 | │ ├── index.html
29 | │ ├── manifest.json
30 | │ ├── scripts
31 | │ ├── styles
32 | │ └── test
33 | ├── bower.json
34 | ├── bower_components
35 | ├── docs
36 | ├── gulpfile.js
37 | ├── node_modules
38 | ├── package.json
39 | ├── platform
40 | │ ├── config.xml
41 | │ ├── hooks
42 | │ ├── platforms
43 | │ ├── plugins
44 | │ └── www
45 | ```
46 |
47 | For further informations of Cordova, please visit [corodova document](https://github.com/MobileChromeApps/mobile-chrome-apps/tree/master/docs)
48 |
49 | ## Configuration
50 |
51 | You need to have some changes of configuration to fit for Mobile Chrome Apps as it was mentioned above.
52 |
53 | ### Configure path for app built by gulp
54 |
55 | - Change the path `dist` in `gulpfile.js` from `dist` to `platform/www/app`, then the app built with Polymer Starter Kit will be placed under `platform/www` will be used by Cordova.
56 | ```js
57 | var DIST = 'platform/www/app';
58 | ```
59 |
60 | - Change the path in `platform/www/background.js` into new path
61 | ```js
62 | chrome.app.runtime.onLaunched.addListener(function() {
63 | chrome.app.window.create('app/index.html', {
64 | width: 244,
65 | height: 380,
66 | });
67 | });
68 | ```
69 |
70 | - Add path `/app` to `app.baseURL` in `app/scripts/app.js'. `platform/www` is root path of app that will prevent errors coming from page routing.
71 | ```js
72 | app.baseUrl = '/app';
73 | ```
74 |
75 | ### Update gulp tasks
76 |
77 | - Using `polybuild(vulcanize + crisper)` task is mandatory because of Chrome Apps doesn't allow inline script blocks according to [CSP](https://developer.chrome.com/apps/contentSecurityPolicy). You should replace current `vulcanize` task with new task below. To do this install `polybuild` first with `npm install --save-dev polybuild` command
78 | ```js
79 | // load polybuild
80 | var polybuild = require('polybuild');
81 |
82 | // Vulcanize granular configuration
83 | gulp.task('vulcanize', function() {
84 | return gulp.src('app/elements/elements.html')
85 | .pipe(polybuild({maximumCrush: true}))
86 | .pipe($.rename(function(file) {
87 | if (file.extname === '.html') {
88 | file.basename = file.basename.replace('.build', '');
89 | }
90 | }))
91 | .pipe(gulp.dest(dist('elements')))
92 | .pipe($.size({title: 'vulcanize'}));
93 | });
94 | ```
95 |
96 | ### More updates
97 |
98 | - Remove useless files generated from Cordova.
99 | ```sh
100 | rm platform/www/index.*
101 | ```
102 | - To complete first route for `home` you need to put try/catch block into the first route code on starting app, in `app/elements/routing.html`, because Chrome Apps doesn't allow using `history` APIs which related to error message `history.pushState/replaceState is not available in packaged apps`.
103 | ```js
104 | try {
105 | page({
106 | hashbang: true
107 | });
108 | } catch (e) {
109 | app.route = 'home';
110 | }
111 | ```
112 |
113 | - Using `@import` instead of `link` to download external Google robot fonts which is related to `Refused to load the stylesheet` errors. Update code in `bower_components/font-roboto/roboto.html` to using `@import` code below
114 | ```
115 | @import url(https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic);
116 | @import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700);
117 | ```
118 |
119 | ## Build and run app
120 |
121 | After done of above steps. run this command on root path that let you see Chrome Apps built with Polymer Starter Kit.
122 |
123 | ```sh
124 | gulp && cd platform && cca run chrome
125 | ```
126 |
127 | or to run on Android emulator or devices
128 |
129 | ```sh
130 | gulp && cd platform && cca run android
131 | ```
132 |
--------------------------------------------------------------------------------
/docs/neon-animated-pages.md:
--------------------------------------------------------------------------------
1 | # Add page transitions with neon-animated-pages
2 |
3 | This recipe focuses on replacing the "static" `iron-pages` component with `neon-animated-pages` in order to display slick animations when transitioning between pages.
4 |
5 | ## Update your dependencies
6 |
7 | - First thing first, we need to replace the `iron-pages` import in `app/elements/elements.html` with a set of components from the `neon-animation` library, including `neon-animated-pages`:
8 |
9 | ```patch
10 | -
11 | ...
12 | +
13 | +
14 | +
15 | +
16 | +
17 | +
18 | +
19 | ```
20 | Note the last two imports are actually animations definitions. We are going to use `slide-from-bottom-animation` and `fade-out-animation` as entry and exit animations respectively. Those animations will apply for all page transitions.
21 |
22 | If you wish to use different animations, make sure you replace those imports by the ones you need.
23 |
24 | ## Replace `iron-pages` with `neon-animated-pages`
25 |
26 | - Next, we need to remove the `iron-pages` from `app/index.html` and replace it with `neon-animated-pages`:
27 |
28 | ```patch
29 | -
30 | +
31 | ...
32 | -
33 | +
34 | ```
35 | This is pretty straightforward, as these elements behave similarly and share a common API, being both based on `Polymer.IronSelectableBehavior`.
36 |
37 | - It is then necessary to replace the children `section` of our page selector with `neon-animatable` elements. You should proceed as follows for the contact section/page for example:
38 |
39 | ```patch
40 | -
41 | +
42 |
43 |
Contact
44 |
This is the contact section
45 |
46 | -
47 | +
48 | ```
49 | Until now, all the pages of our web application were embedded in `section` tags under our page selector `iron-pages`. Replacing those `section` with the convenience element `neon-animatable` is now mandatory because all children of `neon-animated-pages` are required to implement `Polymer.NeonAnimatableBehavior` in order to be animated.
50 |
51 | ## Fix the CSS
52 |
53 | - In `app/styles/app-theme.html`:
54 |
55 | ```patch
56 | - section[data-route="home"] paper-material {
57 | + neon-animatable[data-route="home"] paper-material {
58 | @apply(--paper-font-body2);
59 | }
60 |
61 | - section[data-route="home"] paper-material .subhead {
62 | + neon-animatable[data-route="home"] paper-material .subhead {
63 | @apply(--paper-font-subhead);
64 | }
65 |
66 | + neon-animated-pages {
67 | + height: 100%;
68 | + }
69 | +
70 | paper-material {
71 | border-radius: 2px;
72 | - height: 100%;
73 | padding: 16px 0 16px 0;
74 | width: calc(98.66% - 16px);
75 | margin: 16px auto;
76 | background: white;
77 | }
78 |
79 | ...
80 |
81 | /* Tablet+ */
82 | @media (min-width: 601px) {
83 |
84 | #drawer.paper-drawer-panel > [drawer] {
85 | border-right: 1px solid rgba(0, 0, 0, 0.14);
86 | }
87 |
88 | - iron-pages {
89 | + neon-animated-pages > * {
90 | padding: 48px 62px;
91 | }
92 |
93 | ...
94 | ```
95 |
96 | ## Going further
97 |
98 | This recipe took you through a basic integration of `neon-animated-pages` in Polymer Starter Kit with global and declarative transitions.
99 | However, it doesn't stop there, as `neon-animated-pages` can enable your web application to:
100 |
101 | - Have page specific transitions
102 | - Use multiple animations during one transition
103 | - Only animate part of your page or a specific element
104 | - Use complex animations such as cascaded animations or shared element animations (hero animation, ripple animation)
105 |
106 | Those features require you to extract every page of your web application in its own web-component.
107 | Once that is done, we recommend you take a look at the following resources to learn how to make the most of the `neon-animated-pages` element:
108 |
109 | * [Using neon-animation](https://elements.polymer-project.org/guides/using-neon-animations)
110 | * [Polycasts - Slick web animations](https://www.youtube.com/watch?v=Lwvi1u4XXzc) from Rob Dodson
111 | * [Polycasts - Neon-animated-pages](https://www.youtube.com/watch?v=wMhq1o0DULM) from Rob Dodson
112 |
--------------------------------------------------------------------------------
/docs/polymer-perf.md:
--------------------------------------------------------------------------------
1 | ### Polymer Performance Recipe
2 |
3 | In the following write up we are going to take a look at how to optimize the loading of Web Component enabled websites. The goal here is not to give you a copy and paste approach, but rather to give you the starting components and thought process with how to optimize your web app given your domain constraints.
4 |
5 | Current native support for Web Components is limited but growing, with only Chrome and Opera having a “fully" implemented spec. Due to the limited support, using Polymer or any web components in production across more than just Chrome requires you to load a polyfill. As with any polyfill there is a performance tradeoff, in the run time performance, spec compliance, as well as the network cost overhead. Lets dive into a few approaches that you can use to conditionally load the polyfill only when it is required.
6 |
7 | In your index.html file, create an HTML Import to load your elements bundle. If Web Components are supported, this element will start loading right away, otherwise it will begin loading as soon as the Web Components polyfills have been loaded and given a chance to scan the page.
8 |
9 | Note the use of the `async` attribute on the `link` element. This will ensure that loading the bundle does not block rendering in any way. Also note the `link` element has been given the `id` "bundle," this can be used later to listen for its load event.
10 |
11 | ```html
12 |
13 | ```
14 |
15 | Next we need to detect if Web Components are supported by the browser. If it _does_ support them, then we can skip loading the polyfills entirely. Otherwise, we'll use JavaScript to asynchronously load the polyfills.
16 |
17 | Over in GitHub land @geenlen has cooked up a nifty bit of code to feature detect Web Components support
18 |
19 | ```js
20 | var webComponentsSupported = ('registerElement' in document
21 | && 'import' in document.createElement('link')
22 | && 'content' in document.createElement('template'));
23 | ```
24 |
25 | ```js
26 | if (!webComponentsSupported) {
27 | var script = document.createElement('script');
28 | script.onload = finishLazyLoading;
29 | script.src = '/bower_components/webcomponentsjs/webcomponents-lite.min.js';
30 | document.head.appendChild(script);
31 | } else {
32 | finishLazyLoading();
33 | }
34 | ```
35 |
36 | This bit of code can be placed directly in [`app.js`](https://github.com/PolymerElements/polymer-starter-kit/blob/master/app/scripts/app.js), right under the beginning of the IIFE.
37 |
38 | So what is going on here, how does it work? The first thing that this method does is dynamically create a script tag, then assigns a callback when the resource loads, the code then sets the src of the script tag, and then injects the script tag into the head of our document. Once the tag is placed inside of our document, the network request will start and when the resource is fully downloaded the callback will be invoked.
39 |
40 | Awesome! So now let’s move onto the logic around `finishLazyLoading`.
41 |
42 | ```js
43 | function finishLazyLoading() {
44 |
45 | var onImportLoaded = function() {
46 | console.log('Elements are upgraded!');
47 | // Kickoff your app logic here!
48 | };
49 |
50 | var link = document.querySelector('#bundle');
51 |
52 | if (link.import && link.import.readyState === 'complete') {
53 | onImportLoaded();
54 | } else {
55 | link.addEventListener('load', onImportLoaded);
56 | }
57 | }
58 | ```
59 |
60 | `finishLazyLoading` checks to see if the import has finished loading and calls the `onImportLoaded` handler if it is. `onImportLoaded` is a good place to put your initial application logic because by this point you can be confident that all of your elements are ready. If the import hast not loaded, then we'll setup a listener for the load event of the `link` element and run `onImportLoaded` then.
61 |
62 | As an alternative to having the `link` tag for your imports already in the page, you could choose to load them dynamically.
63 |
64 | ```js
65 | function loadElements(pathToBundle, callback) {
66 | var bundle = document.createElement('link');
67 | bundle.setAttribute('async', true);
68 | bundle.rel = 'import';
69 | bundle.onload = callback;
70 | bundle.href = pathToBundle;
71 |
72 | document.head.appendChild(bundle);
73 | }
74 | ```
75 |
76 | The `loadElements` function uses a similar approach to the one we used to load our polyfills. Note that the user should pass in a callback which will execute once the bundle has finished loading.
77 |
78 | For initial page load there is a slight performance tradeoff for going this route in browsers with Web Components support as it means the page must wait on JavaScript to execute before it can begin loading the elements.
79 |
80 | However, this approach does open up the possibility for you to only have users download the elements that they need for specific pages in your app, and can be extremely useful for subsequent page loads. Consider for instance an application with an admin panel and a general app view. Given the fact that most users in our made up app do not go to the admin panel too often, there is no need for them to always incur the cost of downloading the admin suite of elements. Instead we will only have users download the "bundle" that they need depending on what page they navigate to.
81 |
82 | For example with page.js your router could be structured as follows to optimize page load time, given a few assumptions about how users will be interacting with your app.
83 |
84 | ```js
85 | page.on('admin', function() {
86 | loadElementBundle('elements/admin.html', renderAdminPane);
87 | });
88 | ```
89 |
90 | #### Further Thoughts
91 |
92 | With Polymer, it is easy to fall into the trap of getting a flash of unstyled content, or a blank page while the polyfill and elements are downloading. The best way to avoid these pitfalls is to use a "loading" screen approach. The simplest of the loading approaches is to create a "splash" screen to display while your elements bundle is downloading. The splash screen can be anything from your logo on a colored background, to a full blown skeleton of what the page will look like once everything has loaded up.
93 |
94 | In your index.html, place the markup for your splashscreen in an element with an `id` of "splash".
95 |
96 | ```html
97 |