Remove bootstrap dependency - #1871
Conversation
Replace Bootstrap 3 CSS with custom lightweight stylesheet in solid.css. Bootstrap 3.4.1 had known vulnerabilities and was only used for basic layout (grid, panels, forms, buttons, alerts) and a single glyphicon icon. - Add replacement CSS for all Bootstrap 3 classes used in templates - Replace glyphicon-remove with inline SVG data URI - Remove bootstrap.min.css from common/css/ - Remove bootstrap node_module routes from create-app.mjs - Remove bootstrap from package.json dependencies - Update all 72 template files to drop bootstrap.min.css link
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 75 out of 77 changed files in this pull request and generated no new comments.
Suppressed comments (5)
common/css/solid.css:110
.col-md-*grid rules are currently applied unconditionally, which changes Bootstrap 3 behavior: templates that use onlycol-md-*(e.g.default-views/auth/login.hbs) are expected to stack below 992px, but will now stay split into columns on small screens. Wrap thecol-md-*width/float rules in themin-width: 992pxmedia query to preserve responsive behavior.
.col-xs-3 { width: 25%; float: left; }
.col-xs-9 { width: 75%; float: left; }
.col-md-2 { width: 16.66666667%; float: left; }
.col-md-6 { width: 50%; float: left; }
.col-md-10 { width: 83.33333333%; float: left; }
common/css/solid.css:380
- The password strength validator applies
progress-bar-success|warning|dangerclasses (seecommon/js/solid.js/solid.mjs), but these variants are not defined here. As a result the meter will always use the default.progress-barcolor.
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
common/css/solid.css:230
- The password validator toggles
.has-success|.has-warning|.has-erroron.form-group(seecommon/js/solid.js/solid.mjs), but those state styles are missing. Without them, inputs and feedback icons won't change color/border to reflect validation state.
.form-control-feedback {
position: absolute;
top: 0;
right: 0;
z-index: 2;
common/css/solid.css:451
- Only
.glyphicon-removeis defined, but the password validator swaps the feedback icon betweenglyphicon-remove,glyphicon-ok, andglyphicon-warning-sign. Also, the current.glyphicon-removerule overrides the 34x34 sizing from.form-control-feedback, which will misplace the icon in the input field. Define all three icons and avoid overriding.form-control-feedbacksizing (usecurrentColorso state colors come from.has-*).
.glyphicon-remove {
display: inline-block;
width: 14px;
height: 14px;
vertical-align: text-top;
common/css/solid.css:516
flex-wrap: row wrap;is not valid CSS (valid values arenowrap|wrap|wrap-reverse). Because it is invalid, browsers will ignore it, making the rule misleading and harder to maintain.
position: relative;
display: flex;
flex-direction: column;
flex-wrap: row wrap;
margin: auto;
|
@mmustafasenoglu Thanks for your work |
- Wrap col-md-* grid rules in @media (min-width: 992px) to preserve responsive behavior - Add .progress-bar-success/warning/danger color variants for password strength meter - Add .has-success/.has-warning/.has-error form validation state styles - Add .glyphicon-ok and .glyphicon-warning-sign SVG replacements, use currentColor for state colors - Fix invalid flex-wrap: row wrap to flex-wrap: wrap
|
@bourgeoa Done! All 5 Copilot comments have been addressed:
|
Closes #1867
Bootstrap 3.4.1 has known vulnerabilities and NSS only uses it for basic CSS layout (grid, panels, forms, buttons, alerts) plus a single
glyphicon-removeicon. This replaces the entire dependency with a lightweight custom stylesheet.Changes:
common/css/solid.css: Added replacement CSS for all Bootstrap 3 classes used across templates (grid, panels, forms, buttons, alerts, progress, visibility, typography)common/css/bootstrap.min.css: Deletedlib/create-app.mjs: Removed bootstrap node_module route handlerspackage.json: Removedbootstrapdependency<link>to bootstrap.min.cssThe
glyphicon-removeicon is replaced with an inline SVG data URI, so no font files are needed either.Tests pass (818 passing, 3 pre-existing EADDRINUSE failures).