-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Enable every app to generate their scss file #3197
Conversation
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
$style = substr($style, strpos($style, '/')+1); | ||
$app_path = \OC_App::getAppPath($app); | ||
$app_url = \OC_App::getAppWebPath($app); | ||
$this->append($app_path, $style.'.css', $app_url); | ||
if(!$this->cacheAndAppendScssIfExist($this->serverroot.'/apps', $app.'/'.$style.'.scss', $app)) { |
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.
Use
if(!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', $app)) {
instead to make sure things work when using alternative app directories.
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.
if(!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', null, $app)) {
to pass the correct app parameter
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.
How did I missed that!
Thanks!
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.
Hum, after a quick thought, it seems that we never used the webroot here.
So I'm not sure we need it :p
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.
Webroot isn't needed with scss since we load it trough a route anyway, for css it's still needed afaik
edit: ignore this, was talking about different webroot
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.
I fixed it.
We had the webroot var, but it wasn't used by anything nor passed through a function.
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
@skjnldsv still need to use |
@icewind1991 what do you mean? |
An admin can configure multiple folder that apps can be stored in besides
|
Oh nice! |
Conveniently we already have the variable 3 lines above it 😄 |
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
@icewind1991 you're amazing ! 🚀 |
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.
Works 👍
Current coverage is 54.08% (diff: 0.00%)@@ master #3197 diff @@
==========================================
Files 1299 1299
Lines 80145 81069 +924
Methods 7909 8111 +202
Messages 0 0
Branches 1248 1248
==========================================
+ Hits 43228 43845 +617
- Misses 36917 37224 +307
Partials 0 0
|
I would have loved a little feedback from @nextcloud/security . |
With this pr, every app can use the core scss compile&cache system.
You just have to change your css file to a .scss and the server will handle the rest :)
ex:
/core/css/styles.scss
will be stored underappdata/css/core/styles.css
or:
/settings/css/settings.scss
inappdata/css/settings/settings.css
or:
/apps/mail/css/mail.scss
inappdata/mail/mail.css
@eppfel, it will be helpful for your new app store design #3194 and #3195 :)
@nextcloud/security Can I have a validation from you? What are the possible outcome from such implementation?