polythene-theme
Advanced tools
Comparing version 0.1.19 to 0.1.20
{ | ||
"name": "polythene-theme", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "Polythene default theme", | ||
@@ -9,2 +9,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"fastclick": "^1.0.6", | ||
"j2c": "^0.7.3" | ||
@@ -11,0 +12,0 @@ }, |
@@ -164,2 +164,3 @@ # Polythene-theme | ||
* `object.assign`: Polyfill | ||
* `no-tap-delay`: Wrapper around Fastclick to handle taps when scrolling | ||
* `styler`: Wrapper around j2c to add styles to the head | ||
@@ -169,2 +170,11 @@ * `webfontloader`: See below | ||
## No tap delay | ||
To remove the tap delay on mobile it is advisable to use a library like [Fastclick](https://github.com/ftlabs/fastclick). But because Fastclick has an unresolved issue with tap events while scrolling on iOS, it is better to use the convenience wrapper provided in the default theme. This temporarily removes the Fastclick event an element is scrolled. | ||
~~~javascript | ||
import noTapDelay from 'polythene-theme/common/no-tap-delay'; | ||
~~~ | ||
### Vendor prefixes | ||
@@ -171,0 +181,0 @@ |
@@ -0,1 +1,2 @@ | ||
import p from 'polythene/polythene/polythene'; | ||
import styler from 'polythene-theme/common/styler'; | ||
@@ -23,7 +24,2 @@ | ||
styler.add('polythene-style-theme', theme, roboto); | ||
// Add touch class to remove hovers on touch devices | ||
const isTouchDevice = () => { | ||
return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); | ||
}; | ||
document.querySelector('html').classList.add(isTouchDevice() ? 'touch' : 'no-touch'); | ||
document.querySelector('html').classList.add(p.isTouch() ? 'touch' : 'no-touch'); |
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _polytheneThemeCommonStyler=require("polythene-theme/common/styler");var _polytheneThemeCommonStyler2=_interopRequireDefault(_polytheneThemeCommonStyler);require("polythene-theme/layout/layout");require("polythene-theme/font-roboto/font-roboto");var _polytheneThemeThemeThemeStyle=require("polythene-theme/theme/theme-style");var _polytheneThemeThemeThemeStyle2=_interopRequireDefault(_polytheneThemeThemeThemeStyle);var roboto=[{"html, body":{"font-family":"Roboto, Helvetica, Arial, sans-serif"},"b, strong":{"font-weight":500}}];_polytheneThemeCommonStyler2["default"].add("polythene-style-theme",_polytheneThemeThemeThemeStyle2["default"],roboto);var isTouchDevice=function isTouchDevice(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0};document.querySelector("html").classList.add(isTouchDevice()?"touch":"no-touch"); | ||
"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _polythenePolythenePolythene=require("polythene/polythene/polythene");var _polythenePolythenePolythene2=_interopRequireDefault(_polythenePolythenePolythene);var _polytheneThemeCommonStyler=require("polythene-theme/common/styler");var _polytheneThemeCommonStyler2=_interopRequireDefault(_polytheneThemeCommonStyler);require("polythene-theme/layout/layout");require("polythene-theme/font-roboto/font-roboto");var _polytheneThemeThemeThemeStyle=require("polythene-theme/theme/theme-style");var _polytheneThemeThemeThemeStyle2=_interopRequireDefault(_polytheneThemeThemeThemeStyle);var roboto=[{"html, body":{"font-family":"Roboto, Helvetica, Arial, sans-serif"},"b, strong":{"font-weight":500}}];_polytheneThemeCommonStyler2["default"].add("polythene-style-theme",_polytheneThemeThemeThemeStyle2["default"],roboto);document.querySelector("html").classList.add(_polythenePolythenePolythene2["default"].isTouch()?"touch":"no-touch"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160500
101
2459
211
2
45
+ Addedfastclick@^1.0.6
+ Addedfastclick@1.0.6(transitive)