granite-external-dependencies
A set of elements and mixins to grab external dependencies (CSS and JS...)
granite-external-dependencies
A set of elements and mixins to grab external dependencies (CSS and JS...)
GraniteCssInjector mixin
A mixin to load external CSS files and dynamically inject them in the Shadow DOM of the element.
Elements using this mixing must override two static getters :
nodeModulesPath
: this getter returns the relative path to thenode_modules
foldercssFiles
: this getter returns an array with an object for every dependency. The dependency object needname
andpath
propeties, where the path is the dependency relative path fromnode_modules
folder
Examples:
static get nodeModulesPath() {
return `${GraniteExternalDependencies.pathFromUrl(import.meta.url)}../../../`;
}
static get cssFiles() {
return [
{
name: 'externalCss',
path: `@granite-elements/granite-external-dependencies/demo/external-css.css`
}
];
}
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Dependencies
- @polymer/polymer#^3.0.0
- Released
- 2018-06-18
- Maturity
- IMPORTED
- License
- MIT License
Compatibility
- Framework
- Polymer 3.0+
- Browser
- Browser Independent
granite-external-dependencies - Vaadin Add-on Directory
A set of elements and mixins to grab external dependencies (CSS and JS...)View on GitHub
granite-external-dependencies version 1.0.0
### Dependencies
* @polymer/polymer#^3.0.0
granite-external-dependencies version 1.0.1
### Dependencies
* @polymer/polymer#^3.0.0
granite-external-dependencies version 1.0.2
### Dependencies
* @polymer/polymer#^3.0.0
granite-external-dependencies version 1.0.3
### Dependencies
* @polymer/polymer#^3.0.0
granite-external-dependencies version 1.0.4
### Dependencies
* @polymer/polymer#^3.0.0
granite-external-dependencies version 1.0.5
### Dependencies
* @polymer/polymer#^3.0.0