J4 Issue ?
avatar ghazal
ghazal
22 Sep 2018

Quick reminder,
to test joomla 4 we have two distributions:
on github
on Nightly Builds

I'll be referring to the Nightly Builds one.
I used Node-Sass to compile scss files to css and found out calls to files that should not be there:
Atum:
in template.scss,
// Alert
@import "../../../../build/media/system/scss/jalert";

in font-awesome.scss

@import "../../../../build/media/system/scss/icomoon";

Cassiopeia:
same errors

Obviously, these calls refer to a repertory, /build/, that is not present in this distribution.
NB : /build/ is OK in the github package

Question 1: Will those files be maintained or removed from the "regular" distribution?

Question 2: How people will compile scss to css without resorting to a npm package when there is no obvious way to do it via the admin, or else ?

Other ref : #22058 where I quite agree with @dgrammatiko comments

avatar ghazal ghazal - open - 22 Sep 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Sep 2018
avatar ReLater
ReLater - comment - 22 Sep 2018

See also #21328 where the files were moved to /build/

22-09-_2018_16-07-57

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Sep 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Sep 2018
Category Repository
avatar ghazal
ghazal - comment - 22 Sep 2018

re #21328 Missed that one.
Looks like the call to the above mentioned files has been left behind during this huge makeover - 731 files modified.

avatar ghazal ghazal - change - 23 Sep 2018
Title
[4.0] compile scss : some errors
[4.0] compile scss : some errors in Nightly Builds
avatar ghazal ghazal - edited - 23 Sep 2018
avatar brianteeman brianteeman - change - 23 Sep 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 23 Sep 2018
avatar mbabker
mbabker - comment - 23 Sep 2018

IMO not an issue. If we ship the template SCSS files, we have to ship basically every SCSS resource from every external vendor. AFAIK we aren't including a PHP based SCSS compiler in 4.0 (and it'd be a mistake if we did as it has been proven the compiler used for LESS in 3.x is fatally flawed, I personally won't support inclusion of a SCSS compiler unless it can be proven that 100% of the time on every build the end result is the same as using NPM based tooling), so to do SCSS related changes and re-compile you're going to need an NPM environment and I'd suggest you would be able to download the needed files from this repo for the core templates and adjust the reference paths as needed.

avatar ReLater
ReLater - comment - 23 Sep 2018

So users that want to change scss in installed "core" templates or clones and want to recompile have to use console npm in the future instead of just starting the compiler they usually use, pointing on a single scss file they want to compile. Is that realistic? For programmers maybe.

It would be consequent then to remove the dependent /scss/ folders in "core" templates, too, after build, if they shall be useless for normal users in the future.

avatar mbabker
mbabker - comment - 23 Sep 2018

Long and short custom.css files are going to be a bigger thing I would suggest. Unless you're aware of some pretty darn good LESS/SCSS compilers in PHP that can do the things we're doing with NPM (and this goes beyond just SCSS to CSS, there are things like autoprefixer to do browser specific CSS tweaks without having to explicitly write them in the SCSS source files at play too).

This is where core having "good" template options in the UI and "good" use of things like CSS variables is going to be important.

I wouldn't say there's anyone trying to make it impossible for "normal users" to do things. But at the same time, there are things that just aren't reliable to offer in a PHP application without limiting what tools can be used. SCSS compiling is one of those things (I say LESS compiling is too but people blissfully use that since I don't think it's clear just how bad those results are in some cases). The only fix for that is to not use a compiler at all and write everything in hand-maintained CSS.

avatar ghazal
ghazal - comment - 23 Sep 2018

@mbabker
thanks for your detailed explanation. It answers my 2nd question. No core sass compiling in the works.
Node-Sass NPM package will do the job for me.
And yes, custom.css or user.css will become really handy.

@ReLater
I do agree with your last post.

Nevertheless, in the Nightly Builds distribution, in cassiopeia's template.scss,

// B/C for Icomoon
@import "../../../build/media/system/scss/icomoon";
// Alert
@import "../../../build/media/system/scss/jalert";

(In atum's template.scss, only the second one)

call files that are supposedly in a folder /build/ that doesn't exist in Nightly Builds.
But does in github distribution, no prob.
I guess I'll have to make a pull request.

Anyhow, I had questions about sass/scss in joomla 4 which have been answered.
Thank you both.

avatar ghazal ghazal - change - 23 Sep 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-09-23 17:19:30
Closed_By ghazal
avatar ghazal ghazal - close - 23 Sep 2018
avatar Chacapamac
Chacapamac - comment - 25 Dec 2018

The only fix for that is to not use a compiler at all and write everything in hand-maintained CSS.

And loose all the capabilities of scss ?
Not sure to understand, so far, user.css don’t even work, how should I put my custom code ?

avatar ReLater
ReLater - comment - 25 Dec 2018

user.css don’t even work, how should I put my custom code

Create a file cassiopeia/css/user.css and put your overruling CSS in it.
In index.php it will be included via
$wa->enableAsset('template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr'));
that uses configuration file joomla.asset.json inside template folder.

If it doesn't work for you and you can't find user.css inside your HTML source code, please open a new issue.

And loose all the capabilities of scss ?

Only for the "core templates" and only if you don't use npm and so on. If you use it you can re-establish the folders/files, that are missing after installation/after build process.

Then you only have to modify the build scripts a bit and after some hours ;-) of nagging you can use the "core scss files" and compilation routines for your own template, too.

Joking apart:

Normally one should use a clone/copy of the "core templates" if you want more than just user.css. There you can change everything for your own requirements. Add files, change paths in scss and so on.

If you use standard scss of a Bootstrap 4 package or just your own common scss the compilation works like expected with lots of compilers.

avatar Chacapamac
Chacapamac - comment - 25 Dec 2018

Thanks “ReLater” with your explanation I start to see the light...

avatar Chacapamac
Chacapamac - comment - 26 Dec 2018

If I understand well Joomla 4 will not have a compiler...
RocketTheme is using Leafo SCSS Compiler, I never have a problem with it. I will try.

I just test “user.css” and it is not working
user.css is in the css folder
$wa->enableAsset('template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtf' : 'ltd')); is in the index.php
• joomla.asset.json have the user.css entry

avatar ReLater
ReLater - comment - 26 Dec 2018

I just test “user.css” and it is not working

Do you use a current Nightly Build of Joomla 4? My Joomla 4 is completely outdated. I can't test it.

If it doesn't work for you and you can't find user.css inside your HTML source code, please open a new issue.

BTW: I've tested pure BS4-SCSS with https://extensions.joomla.org/extension/scss-compiler/ (leafo) and it worked. But I don't remeber if I tested the plugin with Joomla 4 without PHP changes inside plugin code.

avatar Chacapamac
Chacapamac - comment - 27 Dec 2018

I reinstall Joomla_4.0.0-alpha6-dev-Development-Full_Package like 5 days ago, I will try to update/reinstall again

avatar Chacapamac
Chacapamac - comment - 27 Dec 2018

Just install new code from today, still not getting user.css to do anything???

Curiously, it is loading with the other css

/joomla4/media/mod_languages/css/template.min.css?7ce45014c73b7b02236d11a310d7deb8

/joomla4/media/vendor/joomla-custom-elements/css/joomla-alert.min.css?7ce45014c73b7b02236d11a310d7deb8

/joomla4/templates/cassiopeia/css/template.min.css?7ce45014c73b7b02236d11a310d7deb8

/joomla4/templates/cassiopeia/css/user.css?7ce45014c73b7b02236d11a310d7deb8

/joomla4/media/vendor/font-awesome/css/font-awesome.min.css?4.7.0

https://fonts.googleapis.com/css?family=Fira+Sans:400

Not sure what the number after ( 7ce45014c73b7b02236d11a310d7deb8 ) mean ?

I have a div id “logo-grad” in a custom module and this css that IS NOT APPEARING in Firefox Dev when I select the div “logo-graf”????

#logo-graf img { float: left !important; margin: -30px 0 0 100px !important; position: absolute !important; width: 140px !important; }

avatar infograf768
infograf768 - comment - 28 Dec 2018

logo-grad or logo-graf ?

avatar Chacapamac
Chacapamac - comment - 29 Dec 2018

My bad “user.css” work perfectly if you don’t have error in your file ... Oops - Now I only have to work to have a custom scss file.

avatar Chacapamac
Chacapamac - comment - 29 Dec 2018

One thing I need clarity on is the presence of a css folder and the need to add our own compiler.

How the SCSS files in the SCSS folder in Cassiopeia are compiled ?

Add a Comment

Login with GitHub to post a comment