Skip to content

CSS Trimming and Minification#3737

Open
lhardt wants to merge 2 commits intocloudfoundry:developfrom
lhardt:css-improvement
Open

CSS Trimming and Minification#3737
lhardt wants to merge 2 commits intocloudfoundry:developfrom
lhardt:css-improvement

Conversation

@lhardt
Copy link

@lhardt lhardt commented Feb 5, 2026

tl;dr

  • Removed unused classes from application.css
  • Created and adopted a minified version of application.css (112529 bytes , compared to the original's 235830 bytes, a ~50% reduction).
  • Raised questions about OSS attribution

longer version

This PR is intended to expand on #1414 , by minifying the CSS file. Instead of minifying the CSS file directly, I preserved the original one, and created an application.min.css file. For the record, I used this minification tool.

Inspecting a little further, It also seems to me that the application.css file composed of:

  • an old version of normalize.css,
  • what appears to be bootstrap v2 or v3,
  • many rules imported from pivotal-one-styles;
  • some custom rules implemented "by hand" to satisfy business needs.

It is essentially overkill, accumulated from another project, when this login-server commit stripped away Sass from the build process and merged all CSS files into what today is application.css. Finally, it ended up here after the contents of login-served were merged into this repo.

The lack of attribution when squashing all Sass might be concerning, and is a possible license violation of the abovementioned CSS libraries. I removed a sizeable part of the "bootstrappy" code that appeared to be unused, as well as gravatar related classes, which could mitigate library risk.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 5, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="/vendor/font-awesome/css/font-awesome.min.css" th:href="@{/vendor/font-awesome/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="/resources/oss/stylesheets/application.css" th:href="@{${assetBaseUrl}+'/stylesheets/application.css'}" rel="stylesheet"/>
<link href="/resources/oss/stylesheets/application.min.css" th:href="@{${assetBaseUrl}+'/stylesheets/application.min.css'}" rel="stylesheet"/>
Copy link
Author

@lhardt lhardt Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure here if I understand this line's usage correctly.

If the host provides external branding and provides their on assetBaseUrl, do we expect all the /resources/oss contents to be present there or do we expect the host to provide their own custom application.css?

A remote possibility is, if the host created their own application.css (but not a minified version) this would ensure the css file is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant