Can't figure out how to have changes to css applied to a running WordPress site

Masato Maeyama
Masato Maeyama used Ask the Experts™
on
Hi,

I am having trouble figuring out how to have modified css applied to an existing WordPress site.

Spec:
- WordPress 4.9.9
- Apache

I would like to know:
- How to change the looks of the website

Issues:
- I don't know which scss files are loaded by web browser. There is no scss files under application directories. You can actually find multiple scss files are loaded from the developper console.
- I have 'main.css' that seems relevant to scss files used to style the website. CSS properties can be found in 'main.css' but browser does not use 'main.css' to rendering purpose. Instead, it seems to use .scss files since look of the site does not change by modifying 'main.css'.

Other note:
- There seems no SCSS related plugins are installed.
- This WordPress website was developed by freelancers who I am not in touch anymore.

Live preview site: http://54.178.243.12/

I have been googling for long time, but not successful so far :(
Any advises are welcome. Looking forward to hearing from you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
Hi,

SCSS files contain pre-compiled CSS, which browsers can't use as they are.

In order to use them, you have to compile the SCSS files into CSS files, which your website then uses. When you do this you have a choice to include what's called a SourceMap. This is useful for debuging purposes. What actually happens is that your website uses the CSS file (main.css in your case), but it also looks at the SourceMap to show which SCSS files the rules in the CSS file originally came from.

When you look at the styles in the Developer Console you have an option to show Original Sources. This means that when you look at a particular style, it will show that it comes from _single-page.scss for example, even though your site is actually using main.css. If you want to edit that particular style, then you would edit the _single-page.scss file and then recompile the SCSS, which in turn will re-generate your main.css file for the browser to use. If you edit the main.css file directly then it will be overwritten everytime your SCSS files are compiled.

On your site, the source files for your CSS (The SCSS files) are found under your themes folder, inside /src/scss.

Author

Commented:
Hi Chris,

Great thanks! Your clarification almost clears my questions.

One problem is that there is no 'src' directory under the themes folder. There is literally no such a 'src' folder. I think the possibility is that the folder was not delivered by the developer. Is this possible, though?

What css I have are 'main.css' and 'main.css.map' under <my-theme>/css folder.
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
OK. In that case it looks like the developer did not ship the Source Files, which makes your SourceMap kind of redundant.

You can delete the main.css.map file and then in your main.css file, probably towards the bottom, you'll see an entry linking to the source map. You can remove that line as well.

Then when you load up your page, you'll only see the main.css file and you can edit that directly.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Perfect. Thank you.

By the way, do you know any workaround to generate scss files that should have been shipped from the sourcemap like reverse engineering?
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
No worries.

Unfortunately, I don't know of any way to reverse engineer the CSS files. I'm guessing it would be impossible because the SCSS files can contain variables and function calls etc. By the time you've got the compiled CSS, all that info will have been lost.

If you've had the theme created for you, you may be able to speak to the developer and ask them for the source files. No real reason to not let you have them.

Author

Commented:
Makes perfect sense. I will contact the developer. Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial