$
This commit is contained in:
19
node_modules/riot/esm/core/add-css-hook.js
generated
vendored
Normal file
19
node_modules/riot/esm/core/add-css-hook.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { IS_DIRECTIVE } from '@riotjs/util';
|
||||
import { getName } from '../utils/dom.js';
|
||||
import { set } from 'bianco.attr';
|
||||
|
||||
/**
|
||||
* Add eventually the "is" attribute to link this DOM node to its css
|
||||
* @param {HTMLElement} element - target root node
|
||||
* @param {string} name - name of the component mounted
|
||||
* @returns {undefined} it's a void function
|
||||
*/
|
||||
|
||||
function addCssHook(element, name) {
|
||||
if (getName(element) !== name) {
|
||||
set(element, IS_DIRECTIVE, name);
|
||||
}
|
||||
}
|
||||
|
||||
export { addCssHook };
|
Reference in New Issue
Block a user