-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
docs: Add example for auto-reloading css #91
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project uses 4 spaces and doesn't use semicolons, we should keep styling consistent across entire project.
49366e1
to
de0508d
Compare
Yes, makes sense. Added the changes. |
Honestly hot-reloading of both scss and typescript should be built-in ags. Interested to hear what @Aylur thinks. For now I use |
I'll probably write a roadmap at some point, because this is a feature I have in mind. |
We can merge this in the meantime though after #95 is fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few suggestions
docs/guide/typescript/theming.md
Outdated
:::code-group | ||
|
||
```ts [app.ts] | ||
const scss = `./style.scss` // Path to you style file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use template literals unless required (backticks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const scss = `${SRC}/style.scss`
SRC
could be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ${SRC}
the new built-in equivalent of ${App.configDir}
or is it just something the user has to set? Because I couldn't find this anywhere in the docs and thus just used ./
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: As Aylur says below, it's AGS-dependent, so it shouldn't be used here.
AGS also defines a global
SRC
variable which will be replaced by the value of the --src flag. By default it will point to the directory ofentryfile
.
Source: Bundling projects(ags docs)
Since Astal is a library it lost App.configDir.
[...]
In cases where you still have to refer to the source dir, AGS defines a global SRC variable.
Source: release notes for ags v2
Also (kind of) relevant: setting up a project(ags docs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Astal docs should not use AGS features as it is meant to be independent. It is a library, there is no concept of a src directory, it's the responsibility of build tools to handle that. ./
is fine for the example, it should just have a note under it like the one here
de0508d
to
df791fd
Compare
@danielwerg Good points. I pushed the changes |
While migrating to the v2 I noticed that the example from the original documentation on how to make auto-reloading of SCSS and CSS work was missing in the documentation. As I rely on it heavily and think it increases the DX alot - especially for new users - , it should be added to the documentation. The example I provided is the one that is running on my machine and works as expected. WDYT?