Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

var attribute dynamic modification exception #144

Closed
1 task done
yifei8 opened this issue Nov 23, 2022 · 0 comments · Fixed by #153
Closed
1 task done

var attribute dynamic modification exception #144

yifei8 opened this issue Nov 23, 2022 · 0 comments · Fixed by #153
Assignees
Labels
bug Something isn't working

Comments

@yifei8
Copy link
Member

yifei8 commented Nov 23, 2022

Affected version

0.12.0 +

No same issues found.

  • Yes, I search all issues but not found.

Steps to Reproduce

见示例

Code example

<!DOCTYPE html>
<html>
<head>
    <style>
        :root {
            --blue: #1e90ff;
            --white: #ffffff;
        }

        body {
            background-color: var(--blue);
        }

        h2 {
            border-bottom: 2px solid var(--blue);
        }

        .container {
            color: var(--blue);
            background-color: var(--white);
            padding: 15px;
        }

        button {
            background-color: var(--white);
            color: var(--blue);
            border: 1px solid var(--blue);
            padding: 5px;
        }
    </style>

    <script>
        // Get the root element
        var r = document.querySelector(':root');
        setTimeout(() => {
            r.style.setProperty('--blue', 'lightblue');
            //UICommandType.setStyle, id: 2 args[0]: -blue args[1]: lightblue nativePtr: Pointer<Never>: address=0x0
        }, 3000);
    </script>
</head>

<body>

    <h1>Change CSS Variable With JavaScript</h1>

    <div class="container">
        <h2>Lorem Ipsum</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar
            felis blandit.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar
            felis blandit.</p>
        <p>
            <button>Yes</button>
            <button>No</button>
        </p>
    </div>
    <br>


</body>

</html>

Expected results

work

Actual results

not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants