Comments (3)
Thank you, above solution sounds as a reasonable one. I think this is exactly what I need (inline CSS for a couple of custom classes). Need to try that still (be back soon with conclusions).
from clerk.
Works!
from clerk.
Actually, replacing the full stylesheet is actually the intended usage. Clerk currently uses tailwind 3's play cdn. This is a javascript script that generates the used classes on-demand (using a mutation observer on the dom). This is primarily intended as a dev affordance.
When publishing in production, tailwind recommends to compile a custom stylesheet containing only the used classes. So we have this abstraction as a way for a user to override the stylesheet, compile it with a different tailwind config or user-appended styles (that can again include the viewer.css) but after going down that road we realized we don't want to be in the business of running a css pipeline for folks.
Also note that you can add inline styles using the html
viewer like so:
^{:nextjournal.clerk/visibility :hide-ns}
(ns style-tag
(:require [nextjournal.clerk :as clerk]))
^{::clerk/viewer :html ::clerk/visibility :hide}
[:style ".my-custom-class { color: blue; background-color: red; border-radius: 5px;}"]
(clerk/html [:div.my-custom-class.p-2 [:h1 "Hello 👋"]])
Please let me know if that works for you.
from clerk.
Related Issues (20)
- Problems with tablecloth HOT 1
- Exceptions are not shown when watcher uses filter-fn HOT 1
- Source File is missing from git Links in Header of static App
- Viewer crashes trying to present exceptions with function values in their data
- static builds should include git links to source documents
- # anchors in links to static builds don't work in Firefox when first opening a page
- Consider adding a specific code example to `clerk/use-headers` or `clerk/table` docstring?
- An edge case where the analyzer crashes
- clerk/image should have an option to set the size HOT 2
- clerk/image should have have an option to encode images as jpeg
- clerk/image should have an option to include an `alt` tag
- The :no-cache option does not propagate through dependencies across files HOT 1
- Inline redefs crash during eval HOT 1
- Improve error message when predicate throws
- Browser UI disappears when exception is thrown HOT 5
- Clerk cannot render nested wrapped values HOT 2
- Clerk doesn't load in java 22 HOT 5
- Top-level multiline strings are not rendered HOT 1
- Scroll position lost after browser refresh / error popup
- honey.sql format crashes in clerk notebook HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clerk.