👀 Reading hidden code
Enter cell code...
Wowie!
👀 Reading hidden code
wowie = html"""
<h5>Wowie!</h5>
"""
👀 Reading hidden code
👀 Reading hidden code
scoped_css2 (generic function with 1 method)
function scoped_css2(x, style)
# html_code = repr(MIME"text/html"(), x)
@htl("""
<pl-css-scoper>
<template shadowroot="open">
<style>
$(style)
</style>
$(x)
</template>
</pl-css-scoper>
""")
end
👀 Reading hidden code
syntax: incomplete: "function" at /home/runner/work/disorganised-mess/disorganised-mess/scoped_css.jl#==#db1220d3-457c-4226-843d-5d1e82e593fd:1 requires end
Computers are hard!
function scoped_css2()
html"""
"""
👀 Reading hidden code
#= html"""
<host-element>
<template shadowroot="open">
<style>
::slotted {
background:green !important;
}
</style>
<h2>Shadow Content (visible if in shadow root)</h2>
<slot></slot>
</template>
<style>
h2 {
background: red;
}
</style>
<h2>Light DOM content (green if slotted)</h2>
</host-element>
""" =#
👀 Reading hidden code
asdf
html"""
<h2>asdf</h2>
"""
👀 Reading hidden code
#= html"""
<host-element>
<template shadowroot="open">
<style>
::slotted(h2), h2 {
background:green !important;
}
</style>
<h2>Shadow Content (visible if in shadow root)</h2>
<slot></slot>
</template>
<style>
h2 {
background: red;
}
</style>
<h2>Light DOM content (green if slotted)</h2>
</host-element>
""" =#
👀 Reading hidden code
using HypertextLiteral
👀 Reading hidden code
html"""
<html>
<h1>Hello Shadow DOM</h1>
</html>
"""
👀 Reading hidden code
Hello Shadow DOM
html"""
<h1>Hello Shadow DOM</h1>
"""
👀 Reading hidden code
scoped_css (generic function with 1 method)
isolated_css = scoped_css
👀 Reading hidden code
isolated_css(@htl("""
<script>alert("123")</script>
<h1>Hello Shadow DOM</h1>
$(embed_display([1,2,3]))
"""),"""
h1 {
color: pink;
}
""")
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
scoped_css(html"<h1>Hello Shadow DOM</h1>","""
h1 {
color: pink;
}
""")
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
scoped_css (generic function with 1 method)
function scoped_css(x, style)
html_code = repr(MIME"text/html"(), x)
@htl("""
<script>
const css_code = $(PlutoRunner.publish_to_js(style))
const html_code = $(PlutoRunner.publish_to_js(html_code))
const host = document.createElement("span")
const shadowRoot = host.attachShadow({mode: 'open'});
shadowRoot.innerHTML = `<style>\${css_code}</style><pluto-output>\${html_code}</pluto-output>`;
return host
</script>
""")
end
👀 Reading hidden code
👀 Reading hidden code