AOEpeople / aoe_technology_radar

Create your own Technology Radar: A static site generator for a full featured Technology Radar. Features: Quadrants, Rings, Dashboard, Radar Visualization, Item History, Search etc..
http://www.aoe.com/techradar
Other
262 stars 121 forks source link

custom.css - classes different on build and serve #440

Closed derkoe closed 5 months ago

derkoe commented 6 months ago

I've tried the new custom.css feature and have struggled with it.

It seems that when running a build the class names are generated differently - for example container__Layout_** when running with npm serve becomes Layout_container when building the application.

As a workaround I have added both styles in my custom.css:

[class^="container__Layout"],
[class^="Layout_container"] {
    background-color: #004985;
}

Maybe you can find a way around this with css-modules.

mathiasschopmans commented 6 months ago

This is a known issue and addressed in the README: https://github.com/AOEpeople/aoe_technology_radar?tab=readme-ov-file#advanced-styling-with-customcss

Maybe we should additionally add "static" classNames.

derkoe commented 6 months ago

In your docs you mention only on of this variants [class^="container__Layout"] - this works for npm serve but you will also have to have a rule [class^="Layout_container"] because the class changes when building

mathiasschopmans commented 5 months ago

Ah, now I got the issue. 💡

There seems to be a inconsistency between Next.js Turbo (used for development) and Webpacks (still used by next.js to build) localIdentName property. ☹️

Turbopack currently only supports next dev and does not support next build.

I'm trying to figure out, if this can be normalized. Otherwise we may stick to Webpack for the dev-server and abandon Next.js' Turbo for now.

mathiasschopmans commented 5 months ago

I switched from Next.js Turbo Builder to good old Webpack for development. This also solves a hot-loading issue. Will be released with v4.2.0 in the next minutes and hopefully fixes your issue. :)

derkoe commented 5 months ago

thx @mathiasschopmans !!!!