NodeBB / NodeBB

Node.js based forum software built for the modern web
https://nodebb.org
GNU General Public License v3.0
14.11k stars 2.78k forks source link

The link on Alert is hard to read #11446

Closed deniapps closed 1 year ago

deniapps commented 1 year ago

image

As per the documentation, "Use the .alert-link utility class to quickly provide matching colored links within any alert."

It appears to be a simple fix by adding the "alert-link" class.

julianlam commented 1 year ago

Thanks @deniapps! That solution looks to be fairly straightforward 😄

barisusakli commented 1 year ago

@deniapps which skin was the one in the screenshot?

deniapps commented 1 year ago

@deniapps which skin was the one in the screenshot?

I use "Yeti", but it seemed to be everywhere. It appears to have been resolved now. That was quick!!!

By the way, switching skins is quite slow. I understand that it may be challenging to make it faster. But I just noticed that the paintbrush icon is flashing when changing skins. :-) Perhaps using a more noticeable loading icon would be helpful.

julianlam commented 1 year ago

Yes, unfortunately that is the byproduct of NodeBB needing to recompile the CSS with the new SCSS variables when a new skin is selected.

Once compiled they are cached for future skin changes.

We don't recompile the stylesheet for all skins, mostly to reduce the build time.

barisusakli commented 1 year ago

We could compile all skins on startup asynchronously so it doesn't make build longer but if you are running on a single core it would make the forum a bit slower after restart.

julianlam commented 1 year ago

Yeah I think it'd be a tough ask given that compiling the SCSS is something that would (I imagine) take up the entirety of the CPU's time... And multiply that by how many skins Bootswatch supports 🤔

deniapps commented 1 year ago

I don't see any hash class names in the style files for the skins, such as https://community.nodebb.org/assets/client-cosmo.css or https://community.nodebb.org/assets/client.css.

It seems that these files may have been pre-compiled and bundled with the theme. If any other styles need to be regenerated during the build process, a separate CSS file may be utilized.

I may have missed something though.

barisusakli commented 1 year ago

Each skin is its own separate css file, compiled by adding bootstrap and our own styles together. WHen a new skin is requested it was generated on demand which can take some time on the first build. I ve added a change into harmony that builds all the skins on startup in production mode https://github.com/NodeBB/nodebb-theme-harmony/commit/6a8aa395d0a7e95726b3ced1ed48a0b1baa27650.

It takes about 3 minutes to build all 25 skins, but it doesn't block startup and happens on a separate thread so I think it's fine.

image

deniapps commented 1 year ago

@barisusakli The async build sounds good, but does it mean that every time we update some custom CSS, it will require us to rebuild all those files? It seems to me that we don't edit those skin CSS files directly, then why not have them as a separated