This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-21
Channels
- # beginners (29)
- # calva (4)
- # clerk (10)
- # clojure (23)
- # clojure-doc (10)
- # clojure-europe (2)
- # clojure-norway (5)
- # clojure-poland (1)
- # clojuredesign-podcast (3)
- # data-science (1)
- # datomic (3)
- # emacs (38)
- # fulcro (4)
- # humbleui (8)
- # hyperfiddle (36)
- # introduce-yourself (4)
- # off-topic (10)
- # portal (14)
- # reitit (6)
- # specter (6)
Regarding the embedding of portal in static pages -- blog posts, etc. -- here are a couple of details worth knowing about: • It captures global key bindings of the page, which might be confusing to a user -- e.g., try pressing the arrow keys in https://scicloj.github.io/clay/ and it will jump to one of the Portal views embedded in it. • It may affect global code highlighting in its use of highlight.js (depending on the method other code in the page is highlighted). ◦ BTW Portal's code highlighting is so nice!
Possibly, this fact about code highlighting can be viewed as a feature. Some blogs may enjoy Portal's code highlighting.
A couple of things could make this feature more convenient:
• be able to consume Portal's highlight.js setup as a separate call to the standalone API, that would work even without embedding any Portal viewers in the page.
• be able to select the Portal theme in standalone mode (which might be difficult to implement in the current workflow I guess?).
I think the embedded mode of Portal needs some more work. To me, it should avoid introducing behaviors and side effects outside of the portions of the dom it is mounted under. I'll look into improving this mode, thanks for pointing this out 🙏
https://github.com/djblue/portal/commit/0060083b22df3736e54f4e19b8086a920a4cfcf4 change should prevent Portal's highlight.js settings from leaking into other parts of the dom. Also, I added https://github.com/djblue/portal/commit/ae9017a10ccb39d01585d9880e1135534a4ad1bbto prevent setting the body background-color when embedded. You may not have experienced this clash if you have your OS preferences set to light mode.
Amazing, thanks. I thought it would be more difficult to isolate with highlight.js. I don't think the keyboard behaviour is a pressing issue in terms of usability, just a tiny detail worth knowing about. Thanks for being so responsive.
For the keyboard issue, I think perhaps in embedded mode, the up/down/left/right shortcuts can be disabled unless a value is selected.
I don't know of anything like that. At some point I thought it was PgUp PgDn, but I cannot reproduce it now.
At least one more Clay user has reported noticing the keybinding behaviour with embedded Portal: https://github.com/scicloj/clay/issues/40
In the image shared at that Issue, we see some font colors affected by Portal (overriding the colors defined by the dark theme). This seems to be a separate effect from the code highlighting and backgound colors we discussed above.
Like the other things, I don't think this is so pressing. Just good to know for now.
that was me with the issue, was searching for clay before posting and haven't seen this thread :man-facepalming:thanks for responding!
Clay version "2-alpha76"
now uses a temporary build of Portal (till its next release), and the global effects on text colour and code highlighting seem to be solved. 🙏