schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs, SSR and SSG.
https://jasprpad.schultek.de
MIT License
1.23k stars 76 forks source link

added StyleSheet object to link external stylesheets #147

Closed cybertheory closed 5 months ago

cybertheory commented 9 months ago

title

Description

Added StyleSheet object to link external stylesheets.

Type of Change

Ready Checklist

If you need help, consider asking for advice on the #contribute channel on Discord.

docs-page[bot] commented 9 months ago

To view this pull requests documentation preview, visit the following URL:

docs.page/schultek/jaspr~147

Documentation is deployed and generated using docs.page.

github-actions[bot] commented 9 months ago

Package Version Report

The following packages have been updated: jaspr : 0.9.3 -> 0.10.0 jaspr_builder : 0.9.3 -> 0.10.0 jaspr_cli : 0.9.3 -> 0.10.0 jaspr_flutter_embed : 0.1.4 -> 0.1.5 jaspr_riverpod : 0.3.8 -> 0.3.9 jaspr_router : 0.3.0 -> 0.3.1 jaspr_test : 0.9.3 -> 0.10.0

schultek commented 9 months ago

Please run melos format before submitting a PR.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2d4d274) 61.78% compared to head (833b50e) 69.17%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #147 +/- ## ========================================== + Coverage 61.78% 69.17% +7.38% ========================================== Files 102 31 -71 Lines 4106 1197 -2909 ========================================== - Hits 2537 828 -1709 + Misses 1569 369 -1200 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

schultek commented 8 months ago

This is not necessary. You can already do this:

Document(
  head: [
    link(rel: "stylesheet", href: "styles.css"),
  ],
  body: App()
)
cybertheory commented 8 months ago

should I make it a component instead, I think it's necessary, who wants to create a new link every time lol And think they are common enough that they should get their parameter in Document without having to use head

cybertheory commented 8 months ago

Also, one thing that confuses me is the separation of jaspr_core and components, even though they are both integrated in the same library. Is the plan to eventually migrate to strictly using BaseComponent's descendents?

schultek commented 8 months ago

should I make it a component instead, I think it's necessary, who wants to create a new link every time lol And think they are common enough that they should get their parameter in Document without having to use head

Then I would make it actually just a parameter on document, like directly a list of strings.

Also, one thing that confuses me is the separation of jaspr_core and components, even though they are both integrated in the same library. Is the plan to eventually migrate to strictly using BaseComponent's descendents?

Tbh I don't like the api of BaseComponent right now and probably will just remove them at some point. Also Im not sure yet if I want to make a separate package for a set of ui components or keep it in the core package.

cybertheory commented 8 months ago

Gotcha! Will try and implement. And yea my two cents are if you are keeping them then we should strictly build off the components. If you want to stick to low level dom stuff then spin it off onto a starter package for component libraries. also! I think you should personally double down on basic components like flutter, because as of right now it seems a bit unclear what Jaspr provides in the area of UI creation and design since I could probably just do dom manipulation with Dart:html...

schultek commented 5 months ago

I'm going to close this as there hasn't been any activity.