Embed the necessary CSS code into the java code.

The CSS file is obtained through CDN now It is difficult to access these overseas websites in my region, and I also need a proxy to access them.

Context

Manifest-Version: 1.0
Created-By: 17.0.8 (Oracle Corporation)
Implementation-Title: spring-security-web
Implementation-Version: 6.1.3
Automatic-Module-Name: spring.security.web

I found four places.

org.springframework.security.web.server.ui.LoginPageGeneratingWebFilter#createPage
org.springframework.security.web.server.ui.LogoutPageGeneratingWebFilter#createPage
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#generateLoginPageHtml
org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#renderLogout

By the way, Springboot3 requires Java17, why not use the Multiline Strings feature?

Comment From: gofunn

Some tools from GPT:

  • PurgeCSS: A popular CSS purging tool to remove unused CSS rules.
  • uncss: A Node.js-based tool that helps you remove unused CSS.
  • Penthouse: A tool for generating Critical CSS, which helps you extract crucial styles related to page loading.

Using these tools can make it easier to automate the extraction of used CSS code, especially for larger projects or complex stylesheets, saving you a significant amount of time and effort.

Comment From: sjohnr

@gofunn thanks for the suggestion!

However, the generated login and logout pages of Spring Security are intended for getting started only, and should be replaced by a custom login page for production deployments. It is quite easy to do and demonstrated in the samples repository.

This request would best be done as part of building a custom login page for yourself. For this reason, I'm going to close this issue.