Skip to content
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

added StyleSheet object to link external stylesheets #147

Closed
wants to merge 3 commits into from

Conversation

cybertheory
Copy link
Contributor

title

Description

Added StyleSheet object to link external stylesheets.

  • Added StyleSheet object to jaspr/lib/src/components/style.dart, so you can add custom CSS StyleSheets
  • Modified _BaseDocument to inlcude option StyleSheet list attribute

Type of Change

  • ❌ Breaking change
  • ✨ New feature or improvement
  • 🛠️ Bug fix
  • 🧹 Code refactor
  • 📝 Documentation
  • 🗑️ Chore

Ready Checklist

  • I've read the Contribution Guide.
  • [x ] In case this PR changes one of the core packages, I've modified the respective CHANGELOG.md file using
    the semantic_changelog format.
  • I updated/added relevant documentation (doc comments with ///).
  • I added myself to the AUTHORS file (optional, if you want to).

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

@cybertheory cybertheory requested a review from schultek as a code owner January 6, 2024 17:38
Copy link

docs-page bot commented Jan 6, 2024

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

docs.page/schultek/jaspr~147

Documentation is deployed and generated using docs.page.

Copy link

github-actions bot commented Jan 6, 2024

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
Copy link
Owner

schultek commented Jan 9, 2024

Please run melos format before submitting a PR.

Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@schultek
Copy link
Owner

This is not necessary. You can already do this:

Document(
  head: [
    link(rel: "stylesheet", href: "styles.css"),
  ],
  body: App()
)

@cybertheory
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Owner

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
Copy link
Contributor Author

cybertheory commented Jan 18, 2024

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
Copy link
Owner

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

@schultek schultek closed this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants