Skip to content

Move class-two-factor-core.php login styles from inline to enqueued stylesheet#807

Merged
georgestephanis merged 4 commits intoWordPress:masterfrom
masteradhoc:style-core-file
Mar 2, 2026
Merged

Move class-two-factor-core.php login styles from inline to enqueued stylesheet#807
georgestephanis merged 4 commits intoWordPress:masterfrom
masteradhoc:style-core-file

Conversation

@masteradhoc
Copy link
Collaborator

@masteradhoc masteradhoc commented Feb 22, 2026

Step to achieve #63

What?

This PR removes the inline CSS block from the Two-Factor login screen and moves them to the user-edit.css stylesheet instead.

Why?

fix the outstanding TODO

How?

The login rendering flow now enqueues user-edit.css before outputting the login header, so the 2FA login UI receives the same styles via the stylesheet.

Testing Instructions

  1. Enable the Two-Factor plugin and configure a 2FA provider for a test user.
  2. Log out, then log in as that user to reach the 2FA challenge screen.
  3. Confirm the styles still apply:

Screenshots or screencast

Changelog Entry

Changed - Load Two-Factor login screen styles from enqueued user-edit.css and remove duplicated inline CSS.

@masteradhoc masteradhoc added this to the 0.16.0 milestone Feb 22, 2026
@github-actions
Copy link

github-actions bot commented Feb 22, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: masteradhoc <masteradhoc@git.wordpress.org>
Co-authored-by: georgestephanis <georgestephanis@git.wordpress.org>
Co-authored-by: dd32 <dd32@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@masteradhoc masteradhoc removed the request for review from dd32 February 22, 2026 22:13
@masteradhoc masteradhoc self-assigned this Feb 22, 2026
Copy link
Collaborator

@georgestephanis georgestephanis left a comment

Choose a reason for hiding this comment

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

Converting @to-do to @to-did? Nice.

I assume they aren't going to cause any conflicts with legacy usage of that file?

@dd32
Copy link
Member

dd32 commented Feb 24, 2026

Should any of those CSS rules be tighter scoped?

Copy link
Collaborator Author

@masteradhoc masteradhoc left a comment

Choose a reason for hiding this comment

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

@dd32 what do you think about the changes here? that would tighten the scope better.

Comment on lines +44 to +50
.input.authcode {
letter-spacing: 0.3em;
}

.input.authcode::placeholder {
opacity: 0.5;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
.input.authcode {
letter-spacing: 0.3em;
}
.input.authcode::placeholder {
opacity: 0.5;
}
#loginform .input.authcode {
letter-spacing: 0.3em;
}
#loginform .input.authcode::placeholder {
opacity: 0.5;
}

Comment on lines +21 to +32
.backup-methods-wrap {
margin-top: 16px;
padding: 0 24px;
}

.backup-methods-wrap a {
text-decoration: none;
}

.backup-methods-wrap ul {
list-style-position: inside;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
.backup-methods-wrap {
margin-top: 16px;
padding: 0 24px;
}
.backup-methods-wrap a {
text-decoration: none;
}
.backup-methods-wrap ul {
list-style-position: inside;
}
#login .backup-methods-wrap {
margin-top: 16px;
padding: 0 24px;
}
#login .backup-methods-wrap a {
text-decoration: none;
}
#login .backup-methods-wrap ul {
list-style-position: inside;
}

Copy link
Collaborator

@georgestephanis georgestephanis left a comment

Choose a reason for hiding this comment

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

Looks reasonable. Merging.

@georgestephanis georgestephanis merged commit 107b7b6 into WordPress:master Mar 2, 2026
28 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Two Factor project board Mar 2, 2026
@masteradhoc masteradhoc deleted the style-core-file branch March 2, 2026 17:26
@masteradhoc
Copy link
Collaborator Author

@georgestephanis as discussed commited this directly in 8d26530 as it was left out by accident.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants