mirror of
https://github.com/MontFerret/ferret.git
synced 2025-01-26 03:51:57 +02:00
7eed93721c
* Added support of computed styles * Updated style updates * Fixed linter issues * Updated styles manipulation in static driver * Updated e2e tests * Updated methods * Updated e2e tests * Updated README
23 lines
385 B
Go
23 lines
385 B
Go
package templates
|
|
|
|
var getStylesTemplate = `
|
|
(el) => {
|
|
const out = {};
|
|
const styles = window.getComputedStyle(el);
|
|
|
|
Object.keys(styles).forEach((key) => {
|
|
if (!isNaN(parseFloat(key))) {
|
|
const name = styles[key];
|
|
const value = styles.getPropertyValue(name);
|
|
out[name] = value;
|
|
}
|
|
});
|
|
|
|
return out;
|
|
}
|
|
`
|
|
|
|
func GetStyles() string {
|
|
return getStylesTemplate
|
|
}
|