Stay organized with collections
Save and categorize content based on your preferences.
blockly > utils > style > getComputedStyle
utils.style.getComputedStyle() function
Retrieves a computed style value of a node. It returns empty string if the property requested is an SVG one and it has not been explicitly set (firefox and webkit).
Copied from Closure's goog.style.getComputedStyle
Signature:
export declare function getComputedStyle(element: Element, property: string): string;
Parameters
Parameter |
Type |
Description |
element |
Element |
Element to get style of. |
property |
string |
Property to get (camel-case). |
Returns:
string
Style value.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["`utils.style.getComputedStyle()` retrieves the computed style value of an element for a specified property."],["It returns an empty string for SVG properties that haven't been explicitly set in Firefox and Webkit."],["This function mirrors the functionality of Closure's `goog.style.getComputedStyle`."],["The function accepts the element and the desired CSS property (in camelCase) as input."],["It returns the computed style value as a string."]]],[]]