Skip to content

Feature/fix bs5 issues - #577

Open
took wants to merge 4 commits into
yiisoft:masterfrom
took:feature/fix-bs5-issues
Open

Feature/fix bs5 issues#577
took wants to merge 4 commits into
yiisoft:masterfrom
took:feature/fix-bs5-issues

Conversation

@took

@took took commented Mar 9, 2026

Copy link
Copy Markdown
Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues Fixes Bootstrap5 issues

@terabytesoftw

Copy link
Copy Markdown
Member

Why do we need to add widgets to the container?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses Bootstrap 5 compatibility issues by updating global widget pager configuration and adding Bootstrap 5-focused validation/error styling in both frontend and backend site CSS.

Changes:

  • Added enhanced invalid/validation error CSS for Bootstrap 5 (including legacy .has-error support) in frontend and backend.
  • Configured Yii DI container defaults so ListView and GridView pagers use yii\bootstrap5\LinkPager.
  • Added CSS for anchor offset scrolling (scroll-margin-top) to account for fixed navbars.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
frontend/web/css/site.css Adds Bootstrap 5 validation/legacy error styles and new navbar/anchor-offset CSS.
frontend/config/main.php Sets DI container defaults for ListView/GridView to use Bootstrap 5 LinkPager.
backend/web/css/site.css Adds Bootstrap 5 validation/legacy error styles and additional navbar/anchor-offset CSS.
backend/config/main.php Sets DI container defaults for ListView/GridView to use Bootstrap 5 LinkPager.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/web/css/site.css Outdated
Comment on lines +149 to +162
/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
.nav li > form > button.logout {
display:block;
text-align: left;
width: 100%;
padding: 10px 0;
}
}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The new logout button styles target .nav li > form > button.logout, but the frontend layout renders the logout button as a direct child of a <form class="d-flex"> inside .navbar (no .nav li wrapper). As a result, this block won’t apply; consider removing it or updating the selector to match the actual navbar markup (e.g., .navbar form > button.logout).

Copilot uses AI. Check for mistakes.
Comment thread backend/web/css/site.css Outdated
Comment on lines +148 to +162
/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
.nav li > form > button.logout {
display:block;
text-align: left;
width: 100%;
padding: 10px 0;
}
}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

This file now contains two separate logout button styling blocks (one earlier in the file and this newly added one). Duplicating the same rules increases the chance of future divergence; please keep a single source of truth (either remove this duplicate block or consolidate with the existing one).

Suggested change
/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}
@media(max-width:767px) {
.nav li > form > button.logout {
display:block;
text-align: left;
width: 100%;
padding: 10px 0;
}
}

Copilot uses AI. Check for mistakes.
Comment thread backend/web/css/site.css Outdated
Comment on lines +149 to +155
.nav li > form > button.logout {
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
.nav li > form > button.logout {

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The newly added logout styles still use .nav li > form > button.logout, but the backend layout outputs the logout button directly inside a .navbar form (no .nav li ancestor). This selector likely won’t match and the intended styling won’t be applied; update the selector to match the current layout structure (e.g., .navbar form > button.logout) when consolidating the rules.

Suggested change
.nav li > form > button.logout {
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}
@media(max-width:767px) {
.nav li > form > button.logout {
.nav li > form > button.logout,
.navbar form > button.logout {
padding-top: 7px;
color: rgba(255, 255, 255, 0.5);
}
@media(max-width:767px) {
.nav li > form > button.logout,
.navbar form > button.logout {

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Merged suggestions from copilot

@terabytesoftw terabytesoftw added the status:code review The pull request needs review. label Mar 9, 2026
@took

took commented Mar 9, 2026

Copy link
Copy Markdown
Author

Why do we need to add widgets to the container?

I've added default configs for both widgets so the pager is properly formatted using BS5.

image vs image

Alternatively, the change could be made here:
https://github.com/yiisoft/yii2-gii/blob/master/src/generators/crud/default/views/index.php

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

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants