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

Add SCSS source maps in debug mode #1667

Merged
merged 3 commits into from Jul 8, 2020
Merged

Conversation

denniserdmann
Copy link
Contributor

The SCSS-Compiler has an option to generate Source Maps for generated CSS files, see https://scssphp.github.io/scssphp/docs/#source-maps

It would be nice to have Source Maps activated, when Contao Debug Mode is activated, too. A basic solution could be adding an inline source map, but there are also options to generate a separate file.

What do you think?

@richardhj
Copy link
Member

It is a simple change that is helping for legacy themes (themes that do not use a gulp or encore workflow) and only runs in dev mode, so +1 from my side.

@aschempp
Copy link
Member

I‘m in favor of always having source maps. They don‘t harm, and they make the minified code readable.

https://m.signalvnoise.com/paying-tribute-to-the-web-with-view-source/

@denniserdmann
Copy link
Contributor Author

I agree, unless there are no perfomance downsides.

@leofeyer
Copy link
Member

leofeyer commented May 1, 2020

Is this a bugfix or a new feature?

@aschempp
Copy link
Member

aschempp commented May 4, 2020

Sounds like a feature to me

@denniserdmann
Copy link
Contributor Author

me, too. Although it would be nice to have in the current LTS

@denniserdmann denniserdmann removed their assignment May 8, 2020
@leofeyer
Copy link
Member

@contao/developers I guess we could add this in Contao 4.9, couldn't we?

@denniserdmann Can you please take care of the failing CI checks?

@ausi
Copy link
Member

ausi commented May 12, 2020

Is this a bugfix or a new feature?

IMO it’s a bugfix, source maps should have been activated ever since.

I guess we could add this in Contao 4.9, couldn't we?

👍

@denniserdmann
Copy link
Contributor Author

Can you please take care of the failing CI checks?

@leofeyer tried my best, but i'm not sure how these checks are working. Changed the file, but error is still there.

@leofeyer
Copy link
Member

You should run composer run cs-fixer in your local fork. It will fix the code automatically.

@denniserdmann
Copy link
Contributor Author

You should run composer run cs-fixer in your local fork. It will fix the code automatically.

What, if i don't have a local fork? ;-)

Yes, I can install it, but i thought there would be an easier way, as made my propose „one the fly“.

@rabauss
Copy link
Contributor

rabauss commented May 25, 2020

Correct formating would be like this:

        if (Config::get('debugMode')) {
            $objCompiler->setSourceMap(Compiler::SOURCE_MAP_INLINE);
        }

@leofeyer leofeyer added the bug label Jun 12, 2020
@leofeyer leofeyer added this to the 4.9 milestone Jun 12, 2020
@leofeyer leofeyer merged commit e145b7d into contao:4.9 Jul 8, 2020
@leofeyer
Copy link
Member

leofeyer commented Jul 8, 2020

Thank you @denniserdmann.

@leofeyer leofeyer changed the title Add SCSS Source Maps in Debug-Mode Add SCSS source maps in debug mode Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants