-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
add an optional css reset #7
Comments
I was thinking about that lately. What would be your usage of selecting I agree for global styles, I'm thinking on adding a new function // main.gleam
pub fn main() {
let assert Ok(cache, render) = sketch.setup()
sketch.global(cache, [
sketch.selector("p", [sketch.text_align("center")]),
sketch.selector("div", [sketch.margin(px(0))]),
])
lustre.application() |> lustre.start()
} I'm still unsure about the API though, and I'm wondering if a CLI in that case wouldn't be better. Something to compile styles to CSS, then we could have something like: // normalize.gleam
pub fn p() {
sketch.class([
sketch.sketch.text_align("center")
])
}
pub fn div() {
sketch.margin(px(0))
} And then run |
I like this approach better: sketch.global(cache, [
sketch.selector("p", [sketch.text_align("center")]),
sketch.selector("div", [sketch.margin(px(0))]),
]) I think the other one gets very limited for pseudo-selectors as you can see here: https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css Maybe something like this: sketch.class([
sketch.width_("100%"),
], [
sketch.selector("p", [sketch.text_align("center")]),
sketch.selector("a", [sketch.color("red")]),
]) |> sketch.on("div") |
I'm missing some descendent selectors in There's right now no way to target sketch.class([
property1,
property2,
sketch.child("div", [
property3,
]),
sketch.neighbors("div", [
property4,
]),
]) By the way I really like the idea of |
FYI, I'll change the init setup of sketch in order to build more easily common CSS. It's still on my to-do list, just building it as things are needed for me mainly, but if you have any idea/experiment to share, feel free! |
The change in init is done, I can experiments on building custom stylesheets! |
I was wondering if it's possible to add that feature. I'm willing to build but I think for that we need to have:
The text was updated successfully, but these errors were encountered: