Skip to content

lessc creates different css than less_middleware #328

@epaulson

Description

@epaulson

I've been wondering a bit about how 'Click ' isn't centered in my install of c-t-h. I've got the map tiles turned off, but here's what I get:

Screen Shot 2021-12-06 at 7 18 29 PM

Here's what I should get:
Screen Shot 2021-12-06 at 7 19 05 PM

The difference is that my CSS file comes from being built by the less-middleware. If I compile and replace styles.css by using lessc, then it's correctly centered as in the 2nd image. If I 'touch' styles.less to make it look like I edited the .less file, and reload the site, the less-middleware notices and rebuilds styles.css, resulting in the incorrect centering for the 1st image - and maybe other CSS issues.
(I figured this out by downloading the CSS from click-that-hood.com and noticing that it correctly centered with that CSS)

Part of the problem is I don't think 'npm run build' actually invokes lessc for me, because I don't have lessc in my PATH, so it doesn't run, but since I run 'npm start' as my next step, less-middleware built styles.css so there actually is some CSS in the public/css directory, just not the right CSS.

Since you're working towards eliminating less-middleware, I don't see any reason to debug it - should I just take less-middleware out of app.js, or should we eliminate app.js and tell people to serve the static HTML using python -m http.server or whatever their favorite small webserver is?

Would you also be OK with a PR that changed package.json from

"build": "node build.js && lessc public/css/styles.less public/css/styles.css",

to

"build": "node build.js && node_modules/less/bin/lessc public/css/styles.less public/css/styles.css",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions