diff --git a/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php b/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php
new file mode 100644
index 0000000000..07f1c464ab
--- /dev/null
+++ b/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php
@@ -0,0 +1,179 @@
+<?php
+
+namespace Drupal\Tests\user\FunctionalJavascript;
+
+use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
+
+/**
+ * Tests the JS components added to the PasswordConfirm render element.
+ *
+ * @group user
+ */
+class PasswordConfirmWidgetTest extends WebDriverTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
+  /**
+   * WebAssert object.
+   *
+   * @var \Drupal\Tests\WebAssert
+   */
+  protected $assert;
+
+  /**
+   * User for testing.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $testUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp(): void {
+    parent::setUp();
+    $this->assert = $this->assertSession();
+
+    // Create a user.
+    $this->testUser = $this->createUser();
+    $this->drupalLogin($this->testUser);
+  }
+
+  /**
+   * Tests the components added to the password confirm widget.
+   */
+  public function testPasswordConfirmWidgetJsComponents() {
+    $this->drupalGet($this->testUser->toUrl('edit-form'));
+
+    $password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
+    $password_parent_selector = '.js-form-item-pass-pass1';
+    $password_confirm_selector = '.js-form-item-pass-pass2';
+    $password_confirm_widget = $this->assert->elementExists('css', $password_confirm_widget_selector);
+    $password_parent_item = $password_confirm_widget->find('css', $password_parent_selector);
+    $password_confirm_item = $password_confirm_widget->find('css', $password_confirm_selector);
+
+    // Check that 'password-parent' and 'confirm-parent' are added to the
+    // appropriate elements.
+    $this->assertNotNull($this->assert->waitForElement('css', "$password_parent_selector.password-parent"));
+    $this->assertTrue($password_parent_item->hasClass('password-parent'));
+    $this->assertNotNull($this->assert->waitForElement('css', "$password_confirm_selector.confirm-parent"));
+    $this->assertTrue($password_confirm_item->hasClass('confirm-parent'));
+
+    // Check the elements of the main password item.
+    $this->assertTrue($password_parent_item->has('css', 'input.js-password-field'));
+
+    // Strength meter and bar.
+    $this->assertTrue($password_parent_item->has('css', 'input.js-password-field + .password-strength > [data-drupal-selector="password-strength-meter"]:first-child [data-drupal-selector="password-strength-indicator"]'));
+
+    // Password strength feedback. No strength text feedback present without
+    // input.
+    $this->assertTrue($password_parent_item->has('css', '.password-strength > [data-drupal-selector="password-strength-meter"] + .password-strength__title:last-child > [data-drupal-selector="password-strength-text"]'));
+    $this->assertEmpty($password_parent_item->find('css', '.password-strength > [data-drupal-selector="password-strength-meter"] + .password-strength__title:last-child > [data-drupal-selector="password-strength-text"]')->getText());
+
+    // Check the elements of the password confirm item.
+    $this->assertTrue($password_confirm_item->has('css', 'input.js-password-confirm'));
+
+     // Check the password suggestions element.
+    $this->assertTrue($password_confirm_item->has('css', "$password_confirm_selector + .password-suggestions"));
+    $this->assertFalse($password_confirm_item->has('css', "$password_confirm_selector + .password-suggestions > ul > li"));
+    $this->assertFalse($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions")->isVisible());
+    $this->assertTrue($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions")->getHtml() === '');
+
+    // Fill only the main input for first.
+    $this->drupalGet($this->testUser->toUrl('edit-form'));
+
+    // Wait for the JS.
+    $this->assert->waitForElement('css', "$password_parent_selector.password-parent");
+
+    // Fill main input.
+    $password_confirm_widget->fillField('Password', 'o');
+
+    // Password tips should be refreshed and get visible.
+    $this->assertNotNull($this->assert->waitForElement('css', "$password_confirm_selector + .password-suggestions > ul > li"));
+    $this->assertTrue($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions > ul > li")->isVisible());
+
+    // Password match message must become invisible.
+    $this->assertFalse($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+
+    // Password strength message should be updated.
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_parent_selector", '<div aria-live="polite" aria-atomic="true" class="password-strength__title">Password strength: <span class="password-strength__text" data-drupal-selector="password-strength-text">Weak</span></div>');
+
+    // Deleting the input must not change the element above.
+    $password_confirm_widget->fillField('Password', 'o');
+    $this->assertFalse($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+    $this->assertTrue($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions > ul > li")->isVisible());
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_parent_selector", '<div aria-live="polite" aria-atomic="true" class="password-strength__title">Password strength: <span class="password-strength__text" data-drupal-selector="password-strength-text">Weak</span></div>');
+
+    // Now fill both the main and confirm input.
+    $password_confirm_widget->fillField('Password', 'oooooooooO0∘');
+    $password_confirm_widget->fillField('Confirm password', 'oooooooooO0∘');
+
+    // Bar should be 100% wide.
+    $this->assert->elementAttributeContains('css', 'input.js-password-field + .password-strength > [data-drupal-selector="password-strength-meter"] [data-drupal-selector="password-strength-indicator"]', 'style', 'width: 100%;');
+    $this->assert->elementTextContains('css', "$password_confirm_widget_selector $password_parent_selector [data-drupal-selector='password-strength-text']", 'Strong');
+
+    // Password match message must be visible.
+    $this->assertTrue($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+    $this->assertTrue($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"] > [data-drupal-selector="password-match-status-text"]')->hasClass('ok'));
+    $this->assert->elementTextContains('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"] > [data-drupal-selector="password-match-status-text"]', 'yes');
+
+    // Password suggestions should get invisible.
+    $this->assertFalse($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions")->isVisible());
+  }
+
+  /**
+   * Ensures that password match message is visible when widget is initialized.
+   */
+  public function testPasswordConfirmMessage() {
+    $this->drupalGet($this->testUser->toUrl('edit-form'));
+    $password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
+    $password_confirm_selector = '.js-form-item-pass-pass2';
+    $password_confirm_widget = $this->assert->elementExists('css', $password_confirm_widget_selector);
+    $password_confirm_item = $password_confirm_widget->find('css', $password_confirm_selector);
+
+    // Password match message.
+    $this->assertTrue($password_confirm_item->has('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]'));
+    $this->assertTrue($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_confirm_selector", '<div aria-live="polite" aria-atomic="true" class="password-confirm-message" data-drupal-selector="password-confirm-message">Passwords match: <span data-drupal-selector="password-match-status-text"></span></div>');
+  }
+
+  /**
+   * Tests the password confirm widget so that only confirm input is filled.
+   */
+  public function testFillConfirmOnly() {
+    $this->drupalGet($this->testUser->toUrl('edit-form'));
+    $password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
+    $password_parent_selector = '.js-form-item-pass-pass1';
+    $password_confirm_selector = '.js-form-item-pass-pass2';
+    $password_confirm_widget = $this->assert->elementExists('css', $password_confirm_widget_selector);
+    $password_confirm_item = $password_confirm_widget->find('css', $password_confirm_selector);
+    $password_parent_item = $password_confirm_widget->find('css', $password_parent_selector);
+
+    // Fill only the confirm input.
+    $password_confirm_widget->fillField('Confirm password', 'o');
+
+    // Password tips should be refreshed and get visible.
+    $this->assertNotNull($this->assert->waitForElement('css', "$password_confirm_selector + .password-suggestions > ul > li"));
+    $this->assertTrue($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions")->isVisible());
+
+    // The appropriate strength text should appear.
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_parent_selector", '<div aria-live="polite" aria-atomic="true" class="password-strength__title">Password strength: <span class="password-strength__text" data-drupal-selector="password-strength-text">Weak</span></div>');
+
+    // Password match.
+    $this->assertTrue($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_confirm_selector [data-drupal-selector='password-confirm-message']", 'Passwords match: <span data-drupal-selector="password-match-status-text" class="error">no</span>');
+
+    // Deleting the input should hide the 'password match', but password
+    // strength and tips must remain visible.
+    $password_confirm_widget->fillField('Confirm password', '');
+    $this->assertFalse($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_confirm_selector [data-drupal-selector='password-confirm-message']", 'Passwords match: <span data-drupal-selector="password-match-status-text" class="error">no</span>');
+    $this->assertTrue($password_confirm_item->find('css', "$password_confirm_selector + .password-suggestions")->isVisible());
+    $this->assertTrue($password_parent_item->find('css', '.password-strength > .password-strength__meter + .password-strength__title')->isVisible());
+    $this->assert->elementContains('css', "$password_confirm_widget_selector $password_parent_selector", '<div aria-live="polite" aria-atomic="true" class="password-strength__title">Password strength: <span class="password-strength__text" data-drupal-selector="password-strength-text">Weak</span></div>');
+  }
+
+}
diff --git a/core/modules/user/tests/src/FunctionalJavascript/PasswordWidgetThemeFunctionTest.php b/core/modules/user/tests/src/FunctionalJavascript/PasswordWidgetThemeFunctionTest.php
new file mode 100644
index 0000000000..5cf76713bd
--- /dev/null
+++ b/core/modules/user/tests/src/FunctionalJavascript/PasswordWidgetThemeFunctionTest.php
@@ -0,0 +1,64 @@
+<?php
+
+namespace Drupal\Tests\user\FunctionalJavascript;
+
+use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
+
+/**
+ * Tests the JS components added to the PasswordConfirm render element.
+ *
+ * @group user
+ */
+class PasswordWidgetThemeFunctionTest extends WebDriverTestBase {
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'password_theme_function_test';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = ['user'];
+
+  /**
+   * User for testing.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $testUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp(): void {
+    parent::setUp();
+    $this->assert = $this->assertSession();
+
+    // Create a user.
+    $this->testUser = $this->createUser();
+    $this->drupalLogin($this->testUser);
+  }
+
+  /**
+   * Tests password widget theme functions and its deprecations.
+   *
+   * @group legacy
+   *
+   * @expectedDeprecation Javascript Deprecation: Returning <span> without data-drupal-selector="password-match-status-text" attribute is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3152101
+   * @expectedDeprecation Javascript Deprecation: The js-password-strength__indicator class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__indicator with a data-drupal-selector="password-strength-indicator" attribute. See https://www.drupal.org/node/3152101
+   * @expectedDeprecation Javascript Deprecation: The js-password-strength__text class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__text with a data-drupal-selector="password-strength-text" attribute. See https://www.drupal.org/node/3152101
+   * @expectedDeprecation Javascript Deprecation: The message property is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The markup should be constructed using messageTips property and Drupal.theme.passwordSuggestions. See https://www.drupal.org/node/3130352
+   */
+  public function testPasswordConfirmWidgetJsComponents() {
+    $assert_session = $this->assertSession();
+
+    $this->drupalGet($this->testUser->toUrl('edit-form'));
+
+    $this->assertNotNull($assert_session->waitForText('Overridden passwordStrength:'));
+    $assert_session->elementTextContains('css', '.password-strength__meter', 'Overridden passwordStrength:');
+    $assert_session->elementTextContains('css', '.password-confirm-message', 'Overridden passwordConfirmMessage:');
+    $this->getSession()->getPage()->fillField('pass[pass1]', 'a');
+    $assert_session->elementTextContains('css', '.password-suggestions', 'Overridden passwordSuggestions:');
+  }
+
+}
diff --git a/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.es6.js b/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.es6.js
new file mode 100644
index 0000000000..add1396a20
--- /dev/null
+++ b/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.es6.js
@@ -0,0 +1,91 @@
+/**
+ * @file
+ * Overrides password theme functions for testing.
+ */
+
+(Drupal => {
+  /**
+   * Constructs a password strength message.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.strengthTitle
+   *   The title that precedes the strength text.
+   *
+   * @return {string}
+   *   Markup for password strength message.
+   */
+  Drupal.theme.passwordStrength = ({ strengthTitle }) => {
+    const strengthIndicator =
+      '<span>Overridden passwordStrength:</span><div class="password-strength__indicator js-password-strength__indicator the-prior-class-is-deprecated" data-drupal-selector="a-distinct-absence-of-password-strength-indicator"></div>';
+    const strengthText =
+      '<span class="password-strength__text js-password-strengh__text the-prior-class-is-deprecated" data-drupal-selector="a-distinct-absence-of-password-strength-text"></span>';
+    return `
+      <div class="password-strength">
+        <div class="password-strength__meter" data-drupal-selector="password-strength-meter">${strengthIndicator}</div>
+        <div aria-live="polite" aria-atomic="true" class="password-strength__title">${strengthTitle} ${strengthText}</div>
+      </div>
+    `;
+  };
+
+  /**
+   * Constructs password suggestions tips.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.hasWeaknesses
+   *   The title that precedes tips.
+   * @param {Array.<string>} tips
+   *   Array containing the tips.
+   *
+   * @return {string}
+   *   Markup for password suggestions.
+   */
+  Drupal.theme.passwordSuggestions = ({ hasWeaknesses }, tips) =>
+    `<div class="password-suggestions">Overridden passwordSuggestions: ${
+      tips.length
+        ? `${hasWeaknesses}<ul><li>${tips.join('</li><li>')}</li></ul>`
+        : ''
+    }</div>`;
+
+  /**
+   * Constructs a password confirm message element.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.confirmTitle
+   *   The translated confirm description that labels the actual confirm text.
+   *
+   * @return {string}
+   *   Markup for the password confirm message.
+   */
+  Drupal.theme.passwordConfirmMessage = ({ confirmTitle }) => {
+    const confirmTextWrapper =
+      '<span>Overridden passwordConfirmMessage:</span><span data-drupal-selector="a-distinct-absence-of-password-match-status-text"></span>';
+    return `<div aria-live="polite" aria-atomic="true" class="password-confirm-message" data-drupal-selector="password-confirm-message">${confirmTitle} ${confirmTextWrapper}</div>`;
+  };
+
+  /**
+   * Confirm deprecation of property in evaluatePasswordStrength() return.
+   *
+   * @type {Drupal~behavior}
+   *
+   * @prop {Drupal~behaviorAttach} attach
+   *   Attaches a check for the deprecated `message` property in the object
+   *   returned by Drupal.evaluatePasswordStrength().
+   */
+  Drupal.behaviors.passwordThemeFunctionTest = {
+    attach(context, settings) {
+      const strength = Drupal.evaluatePasswordStrength(
+        'password',
+        settings.password,
+      );
+
+      // eslint-disable-next-line no-unused-vars
+      const { message } = strength;
+    },
+  };
+})(Drupal);
diff --git a/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.js b/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.js
new file mode 100644
index 0000000000..7f45f8f50d
--- /dev/null
+++ b/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.js
@@ -0,0 +1,33 @@
+/**
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
+
+(function (Drupal) {
+  Drupal.theme.passwordStrength = function (_ref) {
+    var strengthTitle = _ref.strengthTitle;
+    var strengthIndicator = '<span>Overridden passwordStrength:</span><div class="password-strength__indicator js-password-strength__indicator the-prior-class-is-deprecated" data-drupal-selector="a-distinct-absence-of-password-strength-indicator"></div>';
+    var strengthText = '<span class="password-strength__text js-password-strengh__text the-prior-class-is-deprecated" data-drupal-selector="a-distinct-absence-of-password-strength-text"></span>';
+    return "\n      <div class=\"password-strength\">\n        <div class=\"password-strength__meter\" data-drupal-selector=\"password-strength-meter\">".concat(strengthIndicator, "</div>\n        <div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">").concat(strengthTitle, " ").concat(strengthText, "</div>\n      </div>\n    ");
+  };
+
+  Drupal.theme.passwordSuggestions = function (_ref2, tips) {
+    var hasWeaknesses = _ref2.hasWeaknesses;
+    return "<div class=\"password-suggestions\">Overridden passwordSuggestions: ".concat(tips.length ? "".concat(hasWeaknesses, "<ul><li>").concat(tips.join('</li><li>'), "</li></ul>") : '', "</div>");
+  };
+
+  Drupal.theme.passwordConfirmMessage = function (_ref3) {
+    var confirmTitle = _ref3.confirmTitle;
+    var confirmTextWrapper = '<span>Overridden passwordConfirmMessage:</span><span data-drupal-selector="a-distinct-absence-of-password-match-status-text"></span>';
+    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-confirm-message\" data-drupal-selector=\"password-confirm-message\">".concat(confirmTitle, " ").concat(confirmTextWrapper, "</div>");
+  };
+
+  Drupal.behaviors.passwordThemeFunctionTest = {
+    attach: function attach(context, settings) {
+      var strength = Drupal.evaluatePasswordStrength('password', settings.password);
+      var message = strength.message;
+    }
+  };
+})(Drupal);
\ No newline at end of file
diff --git a/core/modules/user/tests/themes/password_theme_function_test/password_theme_function_test.info.yml b/core/modules/user/tests/themes/password_theme_function_test/password_theme_function_test.info.yml
new file mode 100644
index 0000000000..ba973fb6bc
--- /dev/null
+++ b/core/modules/user/tests/themes/password_theme_function_test/password_theme_function_test.info.yml
@@ -0,0 +1,7 @@
+name: 'Password Theme Function Test theme'
+type: theme
+base theme: stark
+description: 'Tests theme functions'
+version: VERSION
+libraries:
+  - password_theme_function_test/password-theme-functions
\ No newline at end of file
diff --git a/core/modules/user/tests/themes/password_theme_function_test/password_theme_function_test.libraries.yml b/core/modules/user/tests/themes/password_theme_function_test/password_theme_function_test.libraries.yml
new file mode 100644
index 0000000000..3f2b7eec22
--- /dev/null
+++ b/core/modules/user/tests/themes/password_theme_function_test/password_theme_function_test.libraries.yml
@@ -0,0 +1,6 @@
+password-theme-functions:
+  js:
+    js/password-theme-functions.js: {}
+  dependencies:
+    - core/drupal
+    - user/drupal.user
diff --git a/core/modules/user/user.es6.js b/core/modules/user/user.es6.js
index d5b8d20060..ef1ccaba99 100644
--- a/core/modules/user/user.es6.js
+++ b/core/modules/user/user.es6.js
@@ -3,7 +3,53 @@
  * User behaviors.
  */
 
-(function($, Drupal, drupalSettings) {
+(($, Drupal) => {
+  /**
+   * An object containing CSS classes used for password widget.
+   *
+   * @type {object}
+   * @prop {string} passwordParent - A CSS class for the parent element.
+   * @prop {string} passwordsMatch - A CSS class indicating password match.
+   * @prop {string} passwordsNotMatch - A CSS class indicating passwords
+   *   doesn't match.
+   * @prop {string} passwordWeak - A CSS class indicating weak password
+   *   strength.
+   * @prop {string} passwordFair - A CSS class indicating fair password
+   *   strength.
+   * @prop {string} passwordGood - A CSS class indicating good password
+   *   strength.
+   * @prop {string} passwordStrong - A CSS class indicating strong password
+   *   strength.
+   * @prop {string} widgetInitial - Initial CSS class that should be removed
+   *   on a state change.
+   * @prop {string} passwordEmpty - A CSS class indicating password has not
+   *   been filled.
+   * @prop {string} passwordFilled - A CSS class indicating password has
+   *   been filled.
+   * @prop {string} confirmEmpty - A CSS class indicating password
+   *   confirmation has not been filled.
+   * @prop {string} confirmFilled - A CSS class indicating password
+   *   confirmation has been filled.
+   */
+  Drupal.user = {
+    password: {
+      css: {
+        passwordParent: 'password-parent',
+        passwordsMatch: 'ok',
+        passwordsNotMatch: 'error',
+        passwordWeak: 'is-weak',
+        passwordFair: 'is-fair',
+        passwordGood: 'is-good',
+        passwordStrong: 'is-strong',
+        widgetInitial: '',
+        passwordEmpty: '',
+        passwordFilled: '',
+        confirmEmpty: '',
+        confirmFilled: '',
+      },
+    },
+  };
+
   /**
    * Attach handlers to evaluate the strength of any password fields and to
    * check that its confirmation is correct.
@@ -16,103 +62,225 @@
    */
   Drupal.behaviors.password = {
     attach(context, settings) {
-      const $passwordInput = $(context)
+      const cssClasses = Drupal.user.password.css;
+      $(context)
         .find('input.js-password-field')
-        .once('password');
-
-      if ($passwordInput.length) {
-        const translate = settings.password;
-
-        const $passwordInputParent = $passwordInput.parent();
-        const $passwordInputParentWrapper = $passwordInputParent.parent();
-        let $passwordSuggestions;
-
-        // Add identifying class to password element parent.
-        $passwordInputParent.addClass('password-parent');
-
-        // Add the password confirmation layer.
-        $passwordInputParentWrapper
-          .find('input.js-password-confirm')
-          .parent()
-          .append(Drupal.theme('passwordConfirmMessage', translate))
-          .addClass('confirm-parent');
-
-        const $confirmInput = $passwordInputParentWrapper.find(
-          'input.js-password-confirm',
-        );
-        const $confirmResult = $passwordInputParentWrapper.find(
-          'div.js-password-confirm-message',
-        );
-        const $confirmChild = $confirmResult.find('span');
-
-        // If the password strength indicator is enabled, add its markup.
-        if (settings.password.showStrengthIndicator) {
-          const passwordMeter = `<div class="password-strength"><div class="password-strength__meter"><div class="password-strength__indicator js-password-strength__indicator"></div></div><div aria-live="polite" aria-atomic="true" class="password-strength__title">${translate.strengthTitle} <span class="password-strength__text js-password-strength__text"></span></div></div>`;
-          $confirmInput
+        .once('password')
+        .each((index, value) => {
+          const $mainInput = $(value);
+          const $mainInputParent = $mainInput
+            .parent()
+            .addClass(cssClasses.passwordParent);
+          const $passwordWidget = $mainInput.closest(
+            '.js-form-type-password-confirm',
+          );
+          const $confirmInput = $passwordWidget.find(
+            'input.js-password-confirm',
+          );
+          const $passwordConfirmMessage = $(
+            Drupal.theme('passwordConfirmMessage', settings.password),
+          );
+
+          let $passwordMatchStatus = $passwordConfirmMessage
+            .find('[data-drupal-selector="password-match-status-text"]')
+            .first();
+          if ($passwordMatchStatus.length === 0) {
+            $passwordMatchStatus = $passwordConfirmMessage.find('span').first();
+            Drupal.deprecationError({
+              message:
+                'Returning <span> without data-drupal-selector="password-match-status-text" attribute is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3152101',
+            });
+          }
+
+          const $confirmInputParent = $confirmInput
             .parent()
-            .after('<div class="password-suggestions description"></div>');
-          $passwordInputParent.append(passwordMeter);
-          $passwordSuggestions = $passwordInputParentWrapper
-            .find('div.password-suggestions')
-            .hide();
-        }
-
-        // Check that password and confirmation inputs match.
-        const passwordCheckMatch = function(confirmInputVal) {
-          const success = $passwordInput.val() === confirmInputVal;
-          const confirmClass = success ? 'ok' : 'error';
-
-          // Fill in the success message and set the class accordingly.
-          $confirmChild
-            .html(translate[`confirm${success ? 'Success' : 'Failure'}`])
-            .removeClass('ok error')
-            .addClass(confirmClass);
-        };
-
-        // Check the password strength.
-        const passwordCheck = function() {
+            .addClass('confirm-parent')
+            .append($passwordConfirmMessage);
+
+          // List of classes to be removed from the strength bar on a state
+          // change.
+          const passwordStrengthBarClassesToRemove = [
+            cssClasses.passwordWeak || '',
+            cssClasses.passwordFair || '',
+            cssClasses.passwordGood || '',
+            cssClasses.passwordStrong || '',
+          ]
+            .join(' ')
+            .trim();
+
+          // List of classes to be removed from the text wrapper on a state
+          // change.
+          const confirmTextWrapperClassesToRemove = [
+            cssClasses.passwordsMatch || '',
+            cssClasses.passwordsNotMatch || '',
+          ]
+            .join(' ')
+            .trim();
+
+          // List of classes to be removed from the widget on a state change.
+          const widgetClassesToRemove = [
+            cssClasses.widgetInitial || '',
+            cssClasses.passwordEmpty || '',
+            cssClasses.passwordFilled || '',
+            cssClasses.confirmEmpty || '',
+            cssClasses.confirmFilled || '',
+          ]
+            .join(' ')
+            .trim();
+
+          const password = {};
+
+          // If the password strength indicator is enabled, add its markup.
           if (settings.password.showStrengthIndicator) {
-            // Evaluate the password strength.
-            const result = Drupal.evaluatePasswordStrength(
-              $passwordInput.val(),
-              settings.password,
+            const $passwordStrength = $(
+              Drupal.theme('passwordStrength', settings.password),
             );
-
-            // Update the suggestions for how to improve the password.
-            if ($passwordSuggestions.html() !== result.message) {
-              $passwordSuggestions.html(result.message);
+            password.$strengthBar = $passwordStrength
+              .find('[data-drupal-selector="password-strength-indicator"]')
+              .first();
+            if (password.$strengthBar.length === 0) {
+              password.$strengthBar = $passwordStrength
+                .find('.js-password-strength__indicator')
+                .first();
+              Drupal.deprecationError({
+                message:
+                  'The js-password-strength__indicator class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__indicator with a data-drupal-selector="password-strength-indicator" attribute. See https://www.drupal.org/node/3152101',
+              });
             }
+            password.$strengthTextWrapper = $passwordStrength
+              .find('[data-drupal-selector="password-strength-text"]')
+              .first();
+            if (password.$strengthTextWrapper.length === 0) {
+              password.$strengthTextWrapper = $passwordStrength
+                .find('.js-password-strength__text')
+                .first();
+              Drupal.deprecationError({
+                message:
+                  'The js-password-strength__text class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__text with a data-drupal-selector="password-strength-text" attribute. See https://www.drupal.org/node/3152101',
+              });
+            }
+            password.$suggestions = $(
+              Drupal.theme('passwordSuggestions', settings.password, [], false),
+            );
 
-            // Only show the description box if a weakness exists in the
-            // password.
-            $passwordSuggestions.toggle(result.strength !== 100);
-
-            // Adjust the length of the strength indicator.
-            $passwordInputParent
-              .find('.js-password-strength__indicator')
-              .css('width', `${result.strength}%`)
-              .removeClass('is-weak is-fair is-good is-strong')
-              .addClass(result.indicatorClass);
-
-            // Update the strength indication text.
-            $passwordInputParent
-              .find('.js-password-strength__text')
-              .html(result.indicatorText);
+            password.$suggestions.hide();
+            $mainInputParent.append($passwordStrength);
+            $confirmInputParent.after(password.$suggestions);
           }
 
-          // Check the value in the confirm input and show results.
-          if ($confirmInput.val()) {
-            passwordCheckMatch($confirmInput.val());
-            $confirmResult.css({ visibility: 'visible' });
-          } else {
-            $confirmResult.css({ visibility: 'hidden' });
+          /**
+           * Adds classes to the widget indicating if the elements are filled.
+           */
+          const addWidgetClasses = () => {
+            $passwordWidget
+              .addClass(
+                $mainInput.val()
+                  ? cssClasses.passwordFilled
+                  : cssClasses.passwordEmpty,
+              )
+              .addClass(
+                $confirmInput.val()
+                  ? cssClasses.confirmFilled
+                  : cssClasses.confirmEmpty,
+              );
+          };
+
+          /**
+           * Check that password and confirmation inputs match.
+           *
+           * @param {string} confirmInputVal
+           *   The value of the confirm input.
+           */
+          const passwordCheckMatch = confirmInputVal => {
+            const passwordsAreMatching = $mainInput.val() === confirmInputVal;
+            const confirmClass = passwordsAreMatching
+              ? cssClasses.passwordsMatch
+              : cssClasses.passwordsNotMatch;
+            const confirmMessage = passwordsAreMatching
+              ? settings.password.confirmSuccess
+              : settings.password.confirmFailure;
+
+            // Update the success message and set the class if needed.
+            if (
+              !$passwordMatchStatus.hasClass(confirmClass) ||
+              !$passwordMatchStatus.html() === confirmMessage
+            ) {
+              if (confirmTextWrapperClassesToRemove) {
+                $passwordMatchStatus.removeClass(
+                  confirmTextWrapperClassesToRemove,
+                );
+              }
+              $passwordMatchStatus.html(confirmMessage).addClass(confirmClass);
+            }
+          };
+
+          /**
+           * Checks the password strength.
+           */
+          const passwordCheck = () => {
+            if (settings.password.showStrengthIndicator) {
+              // Evaluate the password strength.
+              const result = Drupal.evaluatePasswordStrength(
+                $mainInput.val(),
+                settings.password,
+              );
+              const $currentPasswordSuggestions = $(
+                Drupal.theme(
+                  'passwordSuggestions',
+                  settings.password,
+                  result.messageTips,
+                ),
+              );
+
+              // Update the suggestions for how to improve the password if needed.
+              if (
+                password.$suggestions.html() !==
+                $currentPasswordSuggestions.html()
+              ) {
+                password.$suggestions.replaceWith($currentPasswordSuggestions);
+                password.$suggestions = $currentPasswordSuggestions.toggle(
+                  // Only show the description box if a weakness exists in the
+                  // password.
+                  result.strength !== 100,
+                );
+              }
+
+              if (passwordStrengthBarClassesToRemove) {
+                password.$strengthBar.removeClass(
+                  passwordStrengthBarClassesToRemove,
+                );
+              }
+              // Adjust the length of the strength indicator.
+              password.$strengthBar
+                .css('width', `${result.strength}%`)
+                .addClass(result.indicatorClass);
+
+              // Update the strength indication text.
+              password.$strengthTextWrapper.html(result.indicatorText);
+            }
+
+            // Check the value in the confirm input and show results.
+            if ($confirmInput.val()) {
+              passwordCheckMatch($confirmInput.val());
+              $passwordConfirmMessage.css({ visibility: 'visible' });
+            } else {
+              $passwordConfirmMessage.css({ visibility: 'hidden' });
+            }
+
+            if (widgetClassesToRemove) {
+              $passwordWidget.removeClass(widgetClassesToRemove);
+              addWidgetClasses();
+            }
+          };
+
+          if (widgetClassesToRemove) {
+            addWidgetClasses();
           }
-        };
 
-        // Monitor input events.
-        $passwordInput.on('input', passwordCheck);
-        $confirmInput.on('input', passwordCheck);
-      }
+          // Monitor input events.
+          $mainInput.on('input', passwordCheck);
+          $confirmInput.on('input', passwordCheck);
+        });
     },
   };
 
@@ -123,13 +291,14 @@
    *
    * @param {string} password
    *   The password to evaluate.
-   * @param {object} translate
-   *   An object containing the text to display for each strength level.
+   * @param {object} passwordSettings
+   *   A password settings object containing the text to display and the CSS
+   *   classes for each strength level.
    *
    * @return {object}
    *   An object containing strength, message, indicatorText and indicatorClass.
    */
-  Drupal.evaluatePasswordStrength = function(password, translate) {
+  Drupal.evaluatePasswordStrength = (password, passwordSettings) => {
     password = password.trim();
     let indicatorText;
     let indicatorClass;
@@ -146,30 +315,30 @@
     // otherwise use value from the database.
     const $usernameBox = $('input.username');
     const username =
-      $usernameBox.length > 0 ? $usernameBox.val() : translate.username;
+      $usernameBox.length > 0 ? $usernameBox.val() : passwordSettings.username;
 
     // Lose 5 points for every character less than 12, plus a 30 point penalty.
     if (password.length < 12) {
-      msg.push(translate.tooShort);
+      msg.push(passwordSettings.tooShort);
       strength -= (12 - password.length) * 5 + 30;
     }
 
     // Count weaknesses.
     if (!hasLowercase) {
-      msg.push(translate.addLowerCase);
-      weaknesses++;
+      msg.push(passwordSettings.addLowerCase);
+      weaknesses += 1;
     }
     if (!hasUppercase) {
-      msg.push(translate.addUpperCase);
-      weaknesses++;
+      msg.push(passwordSettings.addUpperCase);
+      weaknesses += 1;
     }
     if (!hasNumbers) {
-      msg.push(translate.addNumbers);
-      weaknesses++;
+      msg.push(passwordSettings.addNumbers);
+      weaknesses += 1;
     }
     if (!hasPunctuation) {
-      msg.push(translate.addPunctuation);
-      weaknesses++;
+      msg.push(passwordSettings.addPunctuation);
+      weaknesses += 1;
     }
 
     // Apply penalty for each weakness (balanced against length penalty).
@@ -193,37 +362,46 @@
 
     // Check if password is the same as the username.
     if (password !== '' && password.toLowerCase() === username.toLowerCase()) {
-      msg.push(translate.sameAsUsername);
+      msg.push(passwordSettings.sameAsUsername);
       // Passwords the same as username are always very weak.
       strength = 5;
     }
 
+    const cssClasses = Drupal.user.password.css;
+
     // Based on the strength, work out what text should be shown by the
     // password strength meter.
     if (strength < 60) {
-      indicatorText = translate.weak;
-      indicatorClass = 'is-weak';
+      indicatorText = passwordSettings.weak;
+      indicatorClass = cssClasses.passwordWeak;
     } else if (strength < 70) {
-      indicatorText = translate.fair;
-      indicatorClass = 'is-fair';
+      indicatorText = passwordSettings.fair;
+      indicatorClass = cssClasses.passwordFair;
     } else if (strength < 80) {
-      indicatorText = translate.good;
-      indicatorClass = 'is-good';
+      indicatorText = passwordSettings.good;
+      indicatorClass = cssClasses.passwordGood;
     } else if (strength <= 100) {
-      indicatorText = translate.strong;
-      indicatorClass = 'is-strong';
+      indicatorText = passwordSettings.strong;
+      indicatorClass = cssClasses.passwordStrong;
     }
 
-    // Assemble the final message.
-    msg = `${translate.hasWeaknesses}<ul><li>${msg.join(
+    // Assemble the final message while keeping the original message array.
+    const messageTips = msg;
+    msg = `${passwordSettings.hasWeaknesses}<ul><li>${msg.join(
       '</li><li>',
     )}</li></ul>`;
 
-    return {
-      strength,
-      message: msg,
-      indicatorText,
-      indicatorClass,
-    };
+    return Drupal.deprecatedProperty({
+      target: {
+        strength,
+        message: msg,
+        indicatorText,
+        indicatorClass,
+        messageTips,
+      },
+      deprecatedProperty: 'message',
+      message:
+        'The message property is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The markup should be constructed using messageTips property and Drupal.theme.passwordSuggestions. See https://www.drupal.org/node/3130352',
+    });
   };
-})(jQuery, Drupal, drupalSettings);
+})(jQuery, Drupal);
diff --git a/core/modules/user/user.js b/core/modules/user/user.js
index b82261f7dd..b2a04a69f8 100644
--- a/core/modules/user/user.js
+++ b/core/modules/user/user.js
@@ -5,67 +5,139 @@
 * @preserve
 **/
 
-(function ($, Drupal, drupalSettings) {
+(function ($, Drupal) {
+  Drupal.user = {
+    password: {
+      css: {
+        passwordParent: 'password-parent',
+        passwordsMatch: 'ok',
+        passwordsNotMatch: 'error',
+        passwordWeak: 'is-weak',
+        passwordFair: 'is-fair',
+        passwordGood: 'is-good',
+        passwordStrong: 'is-strong',
+        widgetInitial: '',
+        passwordEmpty: '',
+        passwordFilled: '',
+        confirmEmpty: '',
+        confirmFilled: ''
+      }
+    }
+  };
   Drupal.behaviors.password = {
     attach: function attach(context, settings) {
-      var $passwordInput = $(context).find('input.js-password-field').once('password');
-
-      if ($passwordInput.length) {
-        var translate = settings.password;
-        var $passwordInputParent = $passwordInput.parent();
-        var $passwordInputParentWrapper = $passwordInputParent.parent();
-        var $passwordSuggestions;
-        $passwordInputParent.addClass('password-parent');
-        $passwordInputParentWrapper.find('input.js-password-confirm').parent().append(Drupal.theme('passwordConfirmMessage', translate)).addClass('confirm-parent');
-        var $confirmInput = $passwordInputParentWrapper.find('input.js-password-confirm');
-        var $confirmResult = $passwordInputParentWrapper.find('div.js-password-confirm-message');
-        var $confirmChild = $confirmResult.find('span');
+      var cssClasses = Drupal.user.password.css;
+      $(context).find('input.js-password-field').once('password').each(function (index, value) {
+        var $mainInput = $(value);
+        var $mainInputParent = $mainInput.parent().addClass(cssClasses.passwordParent);
+        var $passwordWidget = $mainInput.closest('.js-form-type-password-confirm');
+        var $confirmInput = $passwordWidget.find('input.js-password-confirm');
+        var $passwordConfirmMessage = $(Drupal.theme('passwordConfirmMessage', settings.password));
+        var $passwordMatchStatus = $passwordConfirmMessage.find('[data-drupal-selector="password-match-status-text"]').first();
+
+        if ($passwordMatchStatus.length === 0) {
+          $passwordMatchStatus = $passwordConfirmMessage.find('span').first();
+          Drupal.deprecationError({
+            message: 'Returning <span> without data-drupal-selector="password-match-status-text" attribute is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3152101'
+          });
+        }
+
+        var $confirmInputParent = $confirmInput.parent().addClass('confirm-parent').append($passwordConfirmMessage);
+        var passwordStrengthBarClassesToRemove = [cssClasses.passwordWeak || '', cssClasses.passwordFair || '', cssClasses.passwordGood || '', cssClasses.passwordStrong || ''].join(' ').trim();
+        var confirmTextWrapperClassesToRemove = [cssClasses.passwordsMatch || '', cssClasses.passwordsNotMatch || ''].join(' ').trim();
+        var widgetClassesToRemove = [cssClasses.widgetInitial || '', cssClasses.passwordEmpty || '', cssClasses.passwordFilled || '', cssClasses.confirmEmpty || '', cssClasses.confirmFilled || ''].join(' ').trim();
+        var password = {};
 
         if (settings.password.showStrengthIndicator) {
-          var passwordMeter = "<div class=\"password-strength\"><div class=\"password-strength__meter\"><div class=\"password-strength__indicator js-password-strength__indicator\"></div></div><div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">".concat(translate.strengthTitle, " <span class=\"password-strength__text js-password-strength__text\"></span></div></div>");
-          $confirmInput.parent().after('<div class="password-suggestions description"></div>');
-          $passwordInputParent.append(passwordMeter);
-          $passwordSuggestions = $passwordInputParentWrapper.find('div.password-suggestions').hide();
+          var $passwordStrength = $(Drupal.theme('passwordStrength', settings.password));
+          password.$strengthBar = $passwordStrength.find('[data-drupal-selector="password-strength-indicator"]').first();
+
+          if (password.$strengthBar.length === 0) {
+            password.$strengthBar = $passwordStrength.find('.js-password-strength__indicator').first();
+            Drupal.deprecationError({
+              message: 'The js-password-strength__indicator class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__indicator with a data-drupal-selector="password-strength-indicator" attribute. See https://www.drupal.org/node/3152101'
+            });
+          }
+
+          password.$strengthTextWrapper = $passwordStrength.find('[data-drupal-selector="password-strength-text"]').first();
+
+          if (password.$strengthTextWrapper.length === 0) {
+            password.$strengthTextWrapper = $passwordStrength.find('.js-password-strength__text').first();
+            Drupal.deprecationError({
+              message: 'The js-password-strength__text class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__text with a data-drupal-selector="password-strength-text" attribute. See https://www.drupal.org/node/3152101'
+            });
+          }
+
+          password.$suggestions = $(Drupal.theme('passwordSuggestions', settings.password, [], false));
+          password.$suggestions.hide();
+          $mainInputParent.append($passwordStrength);
+          $confirmInputParent.after(password.$suggestions);
         }
 
+        var addWidgetClasses = function addWidgetClasses() {
+          $passwordWidget.addClass($mainInput.val() ? cssClasses.passwordFilled : cssClasses.passwordEmpty).addClass($confirmInput.val() ? cssClasses.confirmFilled : cssClasses.confirmEmpty);
+        };
+
         var passwordCheckMatch = function passwordCheckMatch(confirmInputVal) {
-          var success = $passwordInput.val() === confirmInputVal;
-          var confirmClass = success ? 'ok' : 'error';
-          $confirmChild.html(translate["confirm".concat(success ? 'Success' : 'Failure')]).removeClass('ok error').addClass(confirmClass);
+          var passwordsAreMatching = $mainInput.val() === confirmInputVal;
+          var confirmClass = passwordsAreMatching ? cssClasses.passwordsMatch : cssClasses.passwordsNotMatch;
+          var confirmMessage = passwordsAreMatching ? settings.password.confirmSuccess : settings.password.confirmFailure;
+
+          if (!$passwordMatchStatus.hasClass(confirmClass) || !$passwordMatchStatus.html() === confirmMessage) {
+            if (confirmTextWrapperClassesToRemove) {
+              $passwordMatchStatus.removeClass(confirmTextWrapperClassesToRemove);
+            }
+
+            $passwordMatchStatus.html(confirmMessage).addClass(confirmClass);
+          }
         };
 
         var passwordCheck = function passwordCheck() {
           if (settings.password.showStrengthIndicator) {
-            var result = Drupal.evaluatePasswordStrength($passwordInput.val(), settings.password);
+            var result = Drupal.evaluatePasswordStrength($mainInput.val(), settings.password);
+            var $currentPasswordSuggestions = $(Drupal.theme('passwordSuggestions', settings.password, result.messageTips));
+
+            if (password.$suggestions.html() !== $currentPasswordSuggestions.html()) {
+              password.$suggestions.replaceWith($currentPasswordSuggestions);
+              password.$suggestions = $currentPasswordSuggestions.toggle(result.strength !== 100);
+            }
 
-            if ($passwordSuggestions.html() !== result.message) {
-              $passwordSuggestions.html(result.message);
+            if (passwordStrengthBarClassesToRemove) {
+              password.$strengthBar.removeClass(passwordStrengthBarClassesToRemove);
             }
 
-            $passwordSuggestions.toggle(result.strength !== 100);
-            $passwordInputParent.find('.js-password-strength__indicator').css('width', "".concat(result.strength, "%")).removeClass('is-weak is-fair is-good is-strong').addClass(result.indicatorClass);
-            $passwordInputParent.find('.js-password-strength__text').html(result.indicatorText);
+            password.$strengthBar.css('width', "".concat(result.strength, "%")).addClass(result.indicatorClass);
+            password.$strengthTextWrapper.html(result.indicatorText);
           }
 
           if ($confirmInput.val()) {
             passwordCheckMatch($confirmInput.val());
-            $confirmResult.css({
+            $passwordConfirmMessage.css({
               visibility: 'visible'
             });
           } else {
-            $confirmResult.css({
+            $passwordConfirmMessage.css({
               visibility: 'hidden'
             });
           }
+
+          if (widgetClassesToRemove) {
+            $passwordWidget.removeClass(widgetClassesToRemove);
+            addWidgetClasses();
+          }
         };
 
-        $passwordInput.on('input', passwordCheck);
+        if (widgetClassesToRemove) {
+          addWidgetClasses();
+        }
+
+        $mainInput.on('input', passwordCheck);
         $confirmInput.on('input', passwordCheck);
-      }
+      });
     }
   };
 
-  Drupal.evaluatePasswordStrength = function (password, translate) {
+  Drupal.evaluatePasswordStrength = function (password, passwordSettings) {
     password = password.trim();
     var indicatorText;
     var indicatorClass;
@@ -77,31 +149,31 @@
     var hasNumbers = /[0-9]/.test(password);
     var hasPunctuation = /[^a-zA-Z0-9]/.test(password);
     var $usernameBox = $('input.username');
-    var username = $usernameBox.length > 0 ? $usernameBox.val() : translate.username;
+    var username = $usernameBox.length > 0 ? $usernameBox.val() : passwordSettings.username;
 
     if (password.length < 12) {
-      msg.push(translate.tooShort);
+      msg.push(passwordSettings.tooShort);
       strength -= (12 - password.length) * 5 + 30;
     }
 
     if (!hasLowercase) {
-      msg.push(translate.addLowerCase);
-      weaknesses++;
+      msg.push(passwordSettings.addLowerCase);
+      weaknesses += 1;
     }
 
     if (!hasUppercase) {
-      msg.push(translate.addUpperCase);
-      weaknesses++;
+      msg.push(passwordSettings.addUpperCase);
+      weaknesses += 1;
     }
 
     if (!hasNumbers) {
-      msg.push(translate.addNumbers);
-      weaknesses++;
+      msg.push(passwordSettings.addNumbers);
+      weaknesses += 1;
     }
 
     if (!hasPunctuation) {
-      msg.push(translate.addPunctuation);
-      weaknesses++;
+      msg.push(passwordSettings.addPunctuation);
+      weaknesses += 1;
     }
 
     switch (weaknesses) {
@@ -123,30 +195,38 @@
     }
 
     if (password !== '' && password.toLowerCase() === username.toLowerCase()) {
-      msg.push(translate.sameAsUsername);
+      msg.push(passwordSettings.sameAsUsername);
       strength = 5;
     }
 
+    var cssClasses = Drupal.user.password.css;
+
     if (strength < 60) {
-      indicatorText = translate.weak;
-      indicatorClass = 'is-weak';
+      indicatorText = passwordSettings.weak;
+      indicatorClass = cssClasses.passwordWeak;
     } else if (strength < 70) {
-      indicatorText = translate.fair;
-      indicatorClass = 'is-fair';
+      indicatorText = passwordSettings.fair;
+      indicatorClass = cssClasses.passwordFair;
     } else if (strength < 80) {
-      indicatorText = translate.good;
-      indicatorClass = 'is-good';
+      indicatorText = passwordSettings.good;
+      indicatorClass = cssClasses.passwordGood;
     } else if (strength <= 100) {
-      indicatorText = translate.strong;
-      indicatorClass = 'is-strong';
+      indicatorText = passwordSettings.strong;
+      indicatorClass = cssClasses.passwordStrong;
     }
 
-    msg = "".concat(translate.hasWeaknesses, "<ul><li>").concat(msg.join('</li><li>'), "</li></ul>");
-    return {
-      strength: strength,
-      message: msg,
-      indicatorText: indicatorText,
-      indicatorClass: indicatorClass
-    };
+    var messageTips = msg;
+    msg = "".concat(passwordSettings.hasWeaknesses, "<ul><li>").concat(msg.join('</li><li>'), "</li></ul>");
+    return Drupal.deprecatedProperty({
+      target: {
+        strength: strength,
+        message: msg,
+        indicatorText: indicatorText,
+        indicatorClass: indicatorClass,
+        messageTips: messageTips
+      },
+      deprecatedProperty: 'message',
+      message: 'The message property is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The markup should be constructed using messageTips property and Drupal.theme.passwordSuggestions. See https://www.drupal.org/node/3130352'
+    });
   };
-})(jQuery, Drupal, drupalSettings);
\ No newline at end of file
+})(jQuery, Drupal);
\ No newline at end of file
diff --git a/core/modules/user/user.theme.es6.js b/core/modules/user/user.theme.es6.js
index 9c0e4432b5..30db9e3b4c 100644
--- a/core/modules/user/user.theme.es6.js
+++ b/core/modules/user/user.theme.es6.js
@@ -5,11 +5,66 @@
 
 (Drupal => {
   /**
-   * Constructs a password confirm message element
+   * Constructs a password confirm message element.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.confirmTitle
+   *   The translated confirm description that labels the actual confirm text.
+   *
+   * @return {string}
+   *   Markup for the password confirm message.
+   */
+  Drupal.theme.passwordConfirmMessage = ({ confirmTitle }) => {
+    const confirmTextWrapper =
+      '<span data-drupal-selector="password-match-status-text"></span>';
+    return `<div aria-live="polite" aria-atomic="true" class="password-confirm-message" data-drupal-selector="password-confirm-message">${confirmTitle} ${confirmTextWrapper}</div>`;
+  };
+
+  /**
+   * Constructs a password strength message.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.strengthTitle
+   *   The title that precedes the strength text.
+   *
+   * @return {string}
+   *   Markup for password strength message.
+   */
+  Drupal.theme.passwordStrength = ({ strengthTitle }) => {
+    const strengthIndicator =
+      '<div class="password-strength__indicator" data-drupal-selector="password-strength-indicator"></div>';
+    const strengthText =
+      '<span class="password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return `
+      <div class="password-strength">
+        <div class="password-strength__meter" data-drupal-selector="password-strength-meter">${strengthIndicator}</div>
+        <div aria-live="polite" aria-atomic="true" class="password-strength__title">${strengthTitle} ${strengthText}</div>
+      </div>
+    `;
+  };
+
+  /**
+   * Constructs password suggestions tips.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.hasWeaknesses
+   *   The title that precedes tips.
+   * @param {Array.<string>} tips
+   *   Array containing the tips.
    *
    * @return {string}
-   *   A string representing a DOM fragment.
+   *   Markup for password suggestions.
    */
-  Drupal.theme.passwordConfirmMessage = translate =>
-    `<div aria-live="polite" aria-atomic="true" class="password-confirm-message js-password-confirm-message">${translate.confirmTitle} <span></span></div>`;
+  Drupal.theme.passwordSuggestions = ({ hasWeaknesses }, tips) =>
+    `<div class="password-suggestions">${
+      tips.length
+        ? `${hasWeaknesses}<ul><li>${tips.join('</li><li>')}</li></ul>`
+        : ''
+    }</div>`;
 })(Drupal);
diff --git a/core/modules/user/user.theme.js b/core/modules/user/user.theme.js
index 4e00e62319..2a3ae1eeaf 100644
--- a/core/modules/user/user.theme.js
+++ b/core/modules/user/user.theme.js
@@ -6,7 +6,21 @@
 **/
 
 (function (Drupal) {
-  Drupal.theme.passwordConfirmMessage = function (translate) {
-    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-confirm-message js-password-confirm-message\">".concat(translate.confirmTitle, " <span></span></div>");
+  Drupal.theme.passwordConfirmMessage = function (_ref) {
+    var confirmTitle = _ref.confirmTitle;
+    var confirmTextWrapper = '<span data-drupal-selector="password-match-status-text"></span>';
+    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-confirm-message\" data-drupal-selector=\"password-confirm-message\">".concat(confirmTitle, " ").concat(confirmTextWrapper, "</div>");
+  };
+
+  Drupal.theme.passwordStrength = function (_ref2) {
+    var strengthTitle = _ref2.strengthTitle;
+    var strengthIndicator = '<div class="password-strength__indicator" data-drupal-selector="password-strength-indicator"></div>';
+    var strengthText = '<span class="password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return "\n      <div class=\"password-strength\">\n        <div class=\"password-strength__meter\" data-drupal-selector=\"password-strength-meter\">".concat(strengthIndicator, "</div>\n        <div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">").concat(strengthTitle, " ").concat(strengthText, "</div>\n      </div>\n    ");
+  };
+
+  Drupal.theme.passwordSuggestions = function (_ref3, tips) {
+    var hasWeaknesses = _ref3.hasWeaknesses;
+    return "<div class=\"password-suggestions\">".concat(tips.length ? "".concat(hasWeaknesses, "<ul><li>").concat(tips.join('</li><li>'), "</li></ul>") : '', "</div>");
   };
 })(Drupal);
\ No newline at end of file
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php
new file mode 100644
index 0000000000..e7cc5297bb
--- /dev/null
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Drupal\FunctionalJavascriptTests\Theme;
+
+use Drupal\Tests\user\FunctionalJavascript\PasswordConfirmWidgetTest;
+
+/**
+ * Tests the password confirm widget with Claro theme.
+ *
+ * @group claro
+ */
+class ClaroPasswordConfirmWidgetTest extends PasswordConfirmWidgetTest {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'claro';
+
+  /**
+   * Tests that password match message is invisible when widget is initialized.
+   */
+  public function testPasswordConfirmMessage() {
+    $this->drupalGet($this->testUser->toUrl('edit-form'));
+    $password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
+    $password_confirm_selector = '.js-form-item-pass-pass2';
+    $password_confirm_widget = $this->assert->elementExists('css', $password_confirm_widget_selector);
+    $password_confirm_item = $password_confirm_widget->find('css', $password_confirm_selector);
+
+    // Password match message.
+    $this->assertTrue($password_confirm_item->has('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]'));
+    $this->assertFalse($password_confirm_item->find('css', 'input.js-password-confirm + [data-drupal-selector="password-confirm-message"]')->isVisible());
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function testFillConfirmOnly() {
+    // This test is not applicable to Claro because confirm field is hidden
+    // until the password has been filled in the main field.
+  }
+
+}
+
diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
index d1ad7a1d12..b04fa6d9d5 100644
--- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -140,6 +140,7 @@ public static function isDeprecationSkipped($message) {
    */
   public static function getSkippedDeprecations() {
     return [
+      'hello',
       // The following deprecation message is skipped for testing purposes.
       '\Drupal\Tests\SkippedDeprecationTest deprecation',
       // The following Symfony deprecations are introduced in the Symfony 4
diff --git a/core/themes/claro/claro.info.yml b/core/themes/claro/claro.info.yml
index 99397ee0fc..44049c582a 100644
--- a/core/themes/claro/claro.info.yml
+++ b/core/themes/claro/claro.info.yml
@@ -19,9 +19,9 @@ package: Core
 version: VERSION
 experimental: true
 libraries:
- - core/drupal.message
- - core/normalize
- - claro/global-styling
+  - core/drupal.message
+  - core/normalize
+  - claro/global-styling
 libraries-override:
   system/base:
     css:
@@ -69,7 +69,10 @@ libraries-override:
       component:
         assets/vendor/jquery.ui/themes/base/dialog.css: false
 
-  user/drupal.user: claro/form.password-confirm
+  user/drupal.user:
+    css:
+      component:
+        css/user.module.css: false
 
   field_ui/drupal.field_ui:
     css:
@@ -118,6 +121,8 @@ libraries-extend:
     - claro/drupal.shortcut
   core/drupal.ajax:
     - claro/ajax
+  user/drupal.user:
+    - claro/form.password-confirm
   views/views.module:
     - claro/views
   media/media_embed_ckeditor_theme:
diff --git a/core/themes/claro/claro.libraries.yml b/core/themes/claro/claro.libraries.yml
index d4fbca8419..6dc9a5e7df 100644
--- a/core/themes/claro/claro.libraries.yml
+++ b/core/themes/claro/claro.libraries.yml
@@ -1,3 +1,4 @@
+
 global-styling:
   version: VERSION
   css:
@@ -219,11 +220,10 @@ form.password-confirm:
     component:
       css/components/form--password-confirm.css: {}
   js:
-    js/user.js: {}
+    js/user.theme.js: {}
   dependencies:
-    - core/jquery
+    - core/drupal.object.assign
     - core/drupal
-    - core/jquery.once
     - claro/global-styling
 
 views:
diff --git a/core/themes/claro/css/components/form--password-confirm.css b/core/themes/claro/css/components/form--password-confirm.css
index 66cd3d903f..7141769afa 100644
--- a/core/themes/claro/css/components/form--password-confirm.css
+++ b/core/themes/claro/css/components/form--password-confirm.css
@@ -77,7 +77,9 @@
 }
 
 .password-confirm__confirm {
-  margin-bottom: 0;
+  /* Progress spacing + form item description's top margin. */
+  margin-bottom: 0.875rem;
+  transition: none;
 }
 
 .js .password-confirm__confirm {
@@ -98,9 +100,11 @@
 }
 
 .js .is-initial.is-password-empty.is-confirm-empty:not(.form-item--error) .password-confirm__confirm {
-  display: none;
+  overflow: hidden;
   max-height: 0;
   margin-top: 0;
+  margin-bottom: 0;
+  transition: max-height 0s ease-in-out, margin 0s ease-in-out;
 }
 
 /**
diff --git a/core/themes/claro/css/components/form--password-confirm.pcss.css b/core/themes/claro/css/components/form--password-confirm.pcss.css
index cf2cac451b..d31e7ec415 100644
--- a/core/themes/claro/css/components/form--password-confirm.pcss.css
+++ b/core/themes/claro/css/components/form--password-confirm.pcss.css
@@ -32,7 +32,9 @@
 }
 
 .password-confirm__confirm {
-  margin-bottom: 0;
+  /* Progress spacing + form item description's top margin. */
+  margin-bottom: calc(var(--progress-bar-spacing-size) + (6rem / 16));
+  transition: none;
 }
 
 .js .password-confirm__confirm {
@@ -52,9 +54,11 @@
 }
 
 .js .is-initial.is-password-empty.is-confirm-empty:not(.form-item--error) .password-confirm__confirm {
-  display: none;
+  overflow: hidden;
   max-height: 0;
   margin-top: 0;
+  margin-bottom: 0;
+  transition: max-height 0s ease-in-out, margin 0s ease-in-out;
 }
 
 /**
diff --git a/core/themes/claro/js/user.es6.js b/core/themes/claro/js/user.es6.js
deleted file mode 100644
index 2349216d35..0000000000
--- a/core/themes/claro/js/user.es6.js
+++ /dev/null
@@ -1,344 +0,0 @@
-/**
- * @file
- * Overrides Drupal core user.js that provides password strength indicator.
- *
- * @todo remove these overrides after
- *   https://www.drupal.org/project/drupal/issues/3067523 has been resolved.
- */
-
-(($, Drupal) => {
-  /**
-   * This overrides the default Drupal.behaviors.password functionality.
-   *
-   * - Markup has been moved to theme functions so that to enable customizations
-   *   needed for matching Claro's design requirements
-   *   (https://www.drupal.org/project/drupal/issues/3067523).
-   * - Modified classes so that same class names are not being used for different
-   *   elements (https://www.drupal.org/project/drupal/issues/3061265).
-   */
-  Drupal.behaviors.password = {
-    attach(context, settings) {
-      const $passwordInput = $(context)
-        .find('input.js-password-field')
-        .once('password');
-
-      if ($passwordInput.length) {
-        // Settings and translated messages added by
-        // user_form_process_password_confirm().
-        const translate = settings.password;
-
-        // The form element object of the password input.
-        const $passwordInputParent = $passwordInput.parent();
-
-        // The password_confirm form element object.
-        const $passwordWidget = $passwordInput.closest(
-          '.js-form-type-password-confirm',
-        );
-
-        // The password confirm input.
-        const $passwordConfirmInput = $passwordWidget.find(
-          'input.js-password-confirm',
-        );
-
-        // The strength feedback element for the password input.
-        const $passwordInputHelp = $(
-          Drupal.theme.passwordInputHelp(translate.strengthTitle),
-        );
-
-        // The password match feedback for the password confirm input.
-        const $passwordConfirmHelp = $(
-          Drupal.theme.passwordConfirmHelp(translate.confirmTitle),
-        );
-
-        const $passwordInputStrengthBar = $passwordInputHelp.find(
-          '.js-password-strength-bar',
-        );
-        const $passwordInputStrengthMessageWrapper = $passwordInputHelp.find(
-          '.js-password-strength-text',
-        );
-        const $passwordConfirmMatch = $passwordConfirmHelp.find(
-          '.js-password-match-text',
-        );
-        let $passwordSuggestionsTips = $(
-          Drupal.theme.passwordSuggestionsTips('', ''),
-        ).hide();
-
-        // If the password strength indicator is enabled, add its markup.
-        if (settings.password.showStrengthIndicator) {
-          $passwordConfirmInput
-            .after($passwordConfirmHelp)
-            .parent()
-            .after($passwordSuggestionsTips);
-
-          $passwordInputParent.append($passwordInputHelp);
-        }
-
-        // Check that password and confirmation inputs match.
-        const passwordCheckMatch = confirmInputVal => {
-          if (confirmInputVal) {
-            const success = $passwordInput.val() === confirmInputVal;
-            const confirmClass = success ? 'ok' : 'error';
-            const confirmMatchMessage = success
-              ? translate.confirmSuccess
-              : translate.confirmFailure;
-
-            // Update the success message and set the class accordingly if
-            // needed.
-            if (
-              !$passwordConfirmMatch.hasClass(confirmClass) ||
-              !$passwordConfirmMatch.html() === confirmMatchMessage
-            ) {
-              $passwordConfirmMatch
-                .html(confirmMatchMessage)
-                .removeClass('ok error')
-                .addClass(confirmClass);
-            }
-          }
-        };
-
-        // Check the password strength.
-        const passwordCheck = () => {
-          if (settings.password.showStrengthIndicator) {
-            // Evaluate the password strength.
-            const result = Drupal.evaluatePasswordStrength(
-              $passwordInput.val(),
-              settings.password,
-            );
-            const $newSuggestions = $(
-              Drupal.theme.passwordSuggestionsTips(
-                translate.hasWeaknesses,
-                result.tips,
-              ),
-            );
-
-            // Update the suggestions for how to improve the password.
-            if ($newSuggestions.html() !== $passwordSuggestionsTips.html()) {
-              $passwordSuggestionsTips.replaceWith($newSuggestions);
-              $passwordSuggestionsTips = $newSuggestions;
-
-              // Only show the description box if a weakness exists in the
-              // password.
-              $passwordSuggestionsTips.toggle(result.strength !== 100);
-            }
-
-            // Adjust the length of the strength indicator.
-            $passwordInputStrengthBar
-              .css('width', `${result.strength}%`)
-              .removeClass('is-weak is-fair is-good is-strong')
-              .addClass(result.indicatorClass);
-
-            // Update the strength indication text if needed.
-            if (
-              !$passwordInputStrengthMessageWrapper.hasClass(
-                result.indicatorClass,
-              ) ||
-              !$passwordInputStrengthMessageWrapper.html() ===
-                result.indicatorText
-            ) {
-              $passwordInputStrengthMessageWrapper
-                .html(result.indicatorText)
-                .removeClass('is-weak is-fair is-good is-strong')
-                .addClass(result.indicatorClass);
-            }
-          }
-
-          $passwordWidget
-            .removeClass('is-initial')
-            .removeClass('is-password-empty is-password-filled')
-            .removeClass('is-confirm-empty is-confirm-filled');
-
-          // Check the value of the password input and add the proper classes.
-          $passwordWidget.addClass(
-            $passwordInput.val() ? 'is-password-filled' : 'is-password-empty',
-          );
-
-          // Check the value in the confirm input and show results.
-          passwordCheckMatch($passwordConfirmInput.val());
-          $passwordWidget.addClass(
-            $passwordConfirmInput.val()
-              ? 'is-confirm-filled'
-              : 'is-confirm-empty',
-          );
-        };
-
-        // Add initial classes.
-        $passwordWidget
-          .addClass(
-            $passwordInput.val() ? 'is-password-filled' : 'is-password-empty',
-          )
-          .addClass(
-            $passwordConfirmInput.val()
-              ? 'is-confirm-filled'
-              : 'is-confirm-empty',
-          );
-
-        // Monitor input events.
-        $passwordInput.on('input', passwordCheck);
-        $passwordConfirmInput.on('input', passwordCheck);
-      }
-    },
-  };
-
-  /**
-   * Override the default Drupal.evaluatePasswordStrength.
-   *
-   * The default implementation of this function hard codes some markup inside
-   * this function. Rendering markup is now handled by
-   * Drupal.behaviors.password.
-   *
-   * @param {string} password
-   *   Password to evaluate the strength.
-   *
-   * @param {Array.<string>} translate
-   *   Settings and translated messages added by user_form_process_password_confirm().
-   *
-   * @return {Array.<string>}
-   *   Array containing the strength, tips, indicators text and class.
-   */
-  Drupal.evaluatePasswordStrength = (password, translate) => {
-    password = password.trim();
-    let indicatorText;
-    let indicatorClass;
-    let weaknesses = 0;
-    let strength = 100;
-    const tips = [];
-    const hasLowercase = /[a-z]/.test(password);
-    const hasUppercase = /[A-Z]/.test(password);
-    const hasNumbers = /[0-9]/.test(password);
-    const hasPunctuation = /[^a-zA-Z0-9]/.test(password);
-
-    // If there is a username edit box on the page, compare password to that,
-    // otherwise use value from the database.
-    const $usernameBox = $('input.username');
-    const username =
-      $usernameBox.length > 0 ? $usernameBox.val() : translate.username;
-
-    // Lose 5 points for every character less than 12, plus a 30 point penalty.
-    if (password.length < 12) {
-      tips.push(translate.tooShort);
-      strength -= (12 - password.length) * 5 + 30;
-    }
-
-    // Count weaknesses.
-    if (!hasLowercase) {
-      tips.push(translate.addLowerCase);
-      weaknesses += 1;
-    }
-    if (!hasUppercase) {
-      tips.push(translate.addUpperCase);
-      weaknesses += 1;
-    }
-    if (!hasNumbers) {
-      tips.push(translate.addNumbers);
-      weaknesses += 1;
-    }
-    if (!hasPunctuation) {
-      tips.push(translate.addPunctuation);
-      weaknesses += 1;
-    }
-
-    // Apply penalty for each weakness (balanced against length penalty).
-    switch (weaknesses) {
-      case 1:
-        strength -= 12.5;
-        break;
-
-      case 2:
-        strength -= 25;
-        break;
-
-      case 3:
-        strength -= 40;
-        break;
-
-      case 4:
-        strength -= 40;
-        break;
-
-      default:
-        // Default: 0. Nothing to do.
-        break;
-    }
-
-    // Check if password is the same as the username.
-    if (password !== '' && password.toLowerCase() === username.toLowerCase()) {
-      tips.push(translate.sameAsUsername);
-      // Passwords the same as username are always very weak.
-      strength = 5;
-    }
-
-    // Based on the strength, work out what text should be shown by the
-    // password strength meter.
-    if (strength < 60) {
-      indicatorText = translate.weak;
-      indicatorClass = 'is-weak';
-    } else if (strength < 70) {
-      indicatorText = translate.fair;
-      indicatorClass = 'is-fair';
-    } else if (strength < 80) {
-      indicatorText = translate.good;
-      indicatorClass = 'is-good';
-    } else if (strength <= 100) {
-      indicatorText = translate.strong;
-      indicatorClass = 'is-strong';
-    }
-
-    return {
-      strength,
-      tips,
-      indicatorText,
-      indicatorClass,
-    };
-  };
-
-  /**
-   * Password strength feedback for password confirm's main input.
-   *
-   * @param {string} message
-   *   The prefix text for the strength feedback word.
-   *
-   * @return {string}
-   *   The string representing the DOM fragment.
-   */
-  Drupal.theme.passwordInputHelp = message =>
-    `<div class="password-strength">
-      <div class="password-strength__track">
-        <div class="password-strength__bar js-password-strength-bar"></div>
-      </div>
-      <div aria-live="polite" aria-atomic="true" class="password-strength__title">
-        ${message} <span class="password-strength__text js-password-strength-text"></span>
-      </div>
-    </div>`;
-
-  /**
-   * Password match feedback for password confirm input.
-   *
-   * @param {string} message
-   *   The message that precedes the yes|no text.
-   *
-   * @return {string}
-   *   A string representing the DOM fragment.
-   */
-  Drupal.theme.passwordConfirmHelp = message =>
-    `<div aria-live="polite" aria-atomic="true" class="password-match-message">${message} <span class="password-match-message__text js-password-match-text"></span></div>`;
-
-  /**
-   * Password suggestions tips.
-   *
-   * @param {string} title
-   *   The title that precedes tips.
-   * @param {Array.<string>} tips
-   *   Array containing the tips.
-   *
-   * @return {string}
-   *   A string representing the DOM fragment.
-   */
-  Drupal.theme.passwordSuggestionsTips = (title, tips) =>
-    `<div class="password-suggestions">${
-      tips.length
-        ? `${title}<ul class="password-suggestions__tips"><li class="password-suggestions__tip">${tips.join(
-            '</li><li class="password-suggestions__tip">',
-          )}</li></ul>`
-        : ''
-    }</div>`;
-})(jQuery, Drupal);
diff --git a/core/themes/claro/js/user.js b/core/themes/claro/js/user.js
deleted file mode 100644
index fea181e4f6..0000000000
--- a/core/themes/claro/js/user.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
-* DO NOT EDIT THIS FILE.
-* See the following change record for more information,
-* https://www.drupal.org/node/2815083
-* @preserve
-**/
-
-(function ($, Drupal) {
-  Drupal.behaviors.password = {
-    attach: function attach(context, settings) {
-      var $passwordInput = $(context).find('input.js-password-field').once('password');
-
-      if ($passwordInput.length) {
-        var translate = settings.password;
-        var $passwordInputParent = $passwordInput.parent();
-        var $passwordWidget = $passwordInput.closest('.js-form-type-password-confirm');
-        var $passwordConfirmInput = $passwordWidget.find('input.js-password-confirm');
-        var $passwordInputHelp = $(Drupal.theme.passwordInputHelp(translate.strengthTitle));
-        var $passwordConfirmHelp = $(Drupal.theme.passwordConfirmHelp(translate.confirmTitle));
-        var $passwordInputStrengthBar = $passwordInputHelp.find('.js-password-strength-bar');
-        var $passwordInputStrengthMessageWrapper = $passwordInputHelp.find('.js-password-strength-text');
-        var $passwordConfirmMatch = $passwordConfirmHelp.find('.js-password-match-text');
-        var $passwordSuggestionsTips = $(Drupal.theme.passwordSuggestionsTips('', '')).hide();
-
-        if (settings.password.showStrengthIndicator) {
-          $passwordConfirmInput.after($passwordConfirmHelp).parent().after($passwordSuggestionsTips);
-          $passwordInputParent.append($passwordInputHelp);
-        }
-
-        var passwordCheckMatch = function passwordCheckMatch(confirmInputVal) {
-          if (confirmInputVal) {
-            var success = $passwordInput.val() === confirmInputVal;
-            var confirmClass = success ? 'ok' : 'error';
-            var confirmMatchMessage = success ? translate.confirmSuccess : translate.confirmFailure;
-
-            if (!$passwordConfirmMatch.hasClass(confirmClass) || !$passwordConfirmMatch.html() === confirmMatchMessage) {
-              $passwordConfirmMatch.html(confirmMatchMessage).removeClass('ok error').addClass(confirmClass);
-            }
-          }
-        };
-
-        var passwordCheck = function passwordCheck() {
-          if (settings.password.showStrengthIndicator) {
-            var result = Drupal.evaluatePasswordStrength($passwordInput.val(), settings.password);
-            var $newSuggestions = $(Drupal.theme.passwordSuggestionsTips(translate.hasWeaknesses, result.tips));
-
-            if ($newSuggestions.html() !== $passwordSuggestionsTips.html()) {
-              $passwordSuggestionsTips.replaceWith($newSuggestions);
-              $passwordSuggestionsTips = $newSuggestions;
-              $passwordSuggestionsTips.toggle(result.strength !== 100);
-            }
-
-            $passwordInputStrengthBar.css('width', "".concat(result.strength, "%")).removeClass('is-weak is-fair is-good is-strong').addClass(result.indicatorClass);
-
-            if (!$passwordInputStrengthMessageWrapper.hasClass(result.indicatorClass) || !$passwordInputStrengthMessageWrapper.html() === result.indicatorText) {
-              $passwordInputStrengthMessageWrapper.html(result.indicatorText).removeClass('is-weak is-fair is-good is-strong').addClass(result.indicatorClass);
-            }
-          }
-
-          $passwordWidget.removeClass('is-initial').removeClass('is-password-empty is-password-filled').removeClass('is-confirm-empty is-confirm-filled');
-          $passwordWidget.addClass($passwordInput.val() ? 'is-password-filled' : 'is-password-empty');
-          passwordCheckMatch($passwordConfirmInput.val());
-          $passwordWidget.addClass($passwordConfirmInput.val() ? 'is-confirm-filled' : 'is-confirm-empty');
-        };
-
-        $passwordWidget.addClass($passwordInput.val() ? 'is-password-filled' : 'is-password-empty').addClass($passwordConfirmInput.val() ? 'is-confirm-filled' : 'is-confirm-empty');
-        $passwordInput.on('input', passwordCheck);
-        $passwordConfirmInput.on('input', passwordCheck);
-      }
-    }
-  };
-
-  Drupal.evaluatePasswordStrength = function (password, translate) {
-    password = password.trim();
-    var indicatorText;
-    var indicatorClass;
-    var weaknesses = 0;
-    var strength = 100;
-    var tips = [];
-    var hasLowercase = /[a-z]/.test(password);
-    var hasUppercase = /[A-Z]/.test(password);
-    var hasNumbers = /[0-9]/.test(password);
-    var hasPunctuation = /[^a-zA-Z0-9]/.test(password);
-    var $usernameBox = $('input.username');
-    var username = $usernameBox.length > 0 ? $usernameBox.val() : translate.username;
-
-    if (password.length < 12) {
-      tips.push(translate.tooShort);
-      strength -= (12 - password.length) * 5 + 30;
-    }
-
-    if (!hasLowercase) {
-      tips.push(translate.addLowerCase);
-      weaknesses += 1;
-    }
-
-    if (!hasUppercase) {
-      tips.push(translate.addUpperCase);
-      weaknesses += 1;
-    }
-
-    if (!hasNumbers) {
-      tips.push(translate.addNumbers);
-      weaknesses += 1;
-    }
-
-    if (!hasPunctuation) {
-      tips.push(translate.addPunctuation);
-      weaknesses += 1;
-    }
-
-    switch (weaknesses) {
-      case 1:
-        strength -= 12.5;
-        break;
-
-      case 2:
-        strength -= 25;
-        break;
-
-      case 3:
-        strength -= 40;
-        break;
-
-      case 4:
-        strength -= 40;
-        break;
-
-      default:
-        break;
-    }
-
-    if (password !== '' && password.toLowerCase() === username.toLowerCase()) {
-      tips.push(translate.sameAsUsername);
-      strength = 5;
-    }
-
-    if (strength < 60) {
-      indicatorText = translate.weak;
-      indicatorClass = 'is-weak';
-    } else if (strength < 70) {
-      indicatorText = translate.fair;
-      indicatorClass = 'is-fair';
-    } else if (strength < 80) {
-      indicatorText = translate.good;
-      indicatorClass = 'is-good';
-    } else if (strength <= 100) {
-      indicatorText = translate.strong;
-      indicatorClass = 'is-strong';
-    }
-
-    return {
-      strength: strength,
-      tips: tips,
-      indicatorText: indicatorText,
-      indicatorClass: indicatorClass
-    };
-  };
-
-  Drupal.theme.passwordInputHelp = function (message) {
-    return "<div class=\"password-strength\">\n      <div class=\"password-strength__track\">\n        <div class=\"password-strength__bar js-password-strength-bar\"></div>\n      </div>\n      <div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">\n        ".concat(message, " <span class=\"password-strength__text js-password-strength-text\"></span>\n      </div>\n    </div>");
-  };
-
-  Drupal.theme.passwordConfirmHelp = function (message) {
-    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-match-message\">".concat(message, " <span class=\"password-match-message__text js-password-match-text\"></span></div>");
-  };
-
-  Drupal.theme.passwordSuggestionsTips = function (title, tips) {
-    return "<div class=\"password-suggestions\">".concat(tips.length ? "".concat(title, "<ul class=\"password-suggestions__tips\"><li class=\"password-suggestions__tip\">").concat(tips.join('</li><li class="password-suggestions__tip">'), "</li></ul>") : '', "</div>");
-  };
-})(jQuery, Drupal);
\ No newline at end of file
diff --git a/core/themes/claro/js/user.theme.es6.js b/core/themes/claro/js/user.theme.es6.js
new file mode 100644
index 0000000000..ff269eb183
--- /dev/null
+++ b/core/themes/claro/js/user.theme.es6.js
@@ -0,0 +1,81 @@
+/**
+ * @file
+ * Password confirm widget template overrides.
+ */
+
+(Drupal => {
+  Object.assign(Drupal.user.password.css, {
+    passwordWeak: 'is-weak',
+    widgetInitial: 'is-initial',
+    passwordEmpty: 'is-password-empty',
+    passwordFilled: 'is-password-filled',
+    confirmEmpty: 'is-confirm-empty',
+    confirmFilled: 'is-confirm-filled',
+  });
+
+  /**
+   * Constructs a password confirm message element.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.confirmTitle
+   *   The translated confirm description that labels the actual confirm text.
+   *
+   * @return {string}
+   *   Markup for the password confirm message.
+   */
+  Drupal.theme.passwordConfirmMessage = ({ confirmTitle }) => {
+    const confirmTextWrapper =
+      '<span class="password-match-message__text" data-drupal-selector="password-match-status-text"></span>';
+    return `<div aria-live="polite" aria-atomic="true" class="password-match-message" data-drupal-selector="password-confirm-message">${confirmTitle} ${confirmTextWrapper}</div>`;
+  };
+
+  /**
+   * Constructs a password strength message.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.strengthTitle
+   *   The title that precedes the strength text.
+   *
+   * @return {string}
+   *   Markup for the password strength indicator.
+   */
+  Drupal.theme.passwordStrength = ({ strengthTitle }) => {
+    const strengthBar =
+      '<div class="password-strength__bar" data-drupal-selector="password-strength-indicator"></div>';
+    const strengthText =
+      '<span class="password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return `
+      <div class="password-strength">
+        <div class="password-strength__track" data-drupal-selector="password-strength-meter">${strengthBar}</div>
+        <div aria-live="polite" aria-atomic="true" class="password-strength__title">${strengthTitle} ${strengthText}</div>
+      </div>
+    `;
+  };
+
+  /**
+   * Constructs password suggestions tips.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated tex  t to
+   *   display.
+   * @param {string} passwordSettings.hasWeaknesses
+   *   The title that precedes tips.
+   * @param {Array.<string>} tips
+   *   Array containing the tips.
+   *
+   * @return {string}
+   *   Markup for the password suggestions.
+   */
+  Drupal.theme.passwordSuggestions = ({ hasWeaknesses }, tips) =>
+    `<div class="password-suggestions">${
+      tips.length
+        ? `${hasWeaknesses}<ul class="password-suggestions__tips"><li class="password-suggestions__tip">${tips.join(
+            '</li><li class="password-suggestions__tip">',
+          )}</li></ul>`
+        : ''
+    }</div>`;
+})(Drupal);
diff --git a/core/themes/claro/js/user.theme.js b/core/themes/claro/js/user.theme.js
new file mode 100644
index 0000000000..f2e3b141d9
--- /dev/null
+++ b/core/themes/claro/js/user.theme.js
@@ -0,0 +1,35 @@
+/**
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
+
+(function (Drupal) {
+  Object.assign(Drupal.user.password.css, {
+    passwordWeak: 'is-weak',
+    widgetInitial: 'is-initial',
+    passwordEmpty: 'is-password-empty',
+    passwordFilled: 'is-password-filled',
+    confirmEmpty: 'is-confirm-empty',
+    confirmFilled: 'is-confirm-filled'
+  });
+
+  Drupal.theme.passwordConfirmMessage = function (_ref) {
+    var confirmTitle = _ref.confirmTitle;
+    var confirmTextWrapper = '<span class="password-match-message__text" data-drupal-selector="password-match-status-text"></span>';
+    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-match-message\" data-drupal-selector=\"password-confirm-message\">".concat(confirmTitle, " ").concat(confirmTextWrapper, "</div>");
+  };
+
+  Drupal.theme.passwordStrength = function (_ref2) {
+    var strengthTitle = _ref2.strengthTitle;
+    var strengthBar = '<div class="password-strength__bar" data-drupal-selector="password-strength-indicator"></div>';
+    var strengthText = '<span class="password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return "\n      <div class=\"password-strength\">\n        <div class=\"password-strength__track\" data-drupal-selector=\"password-strength-meter\">".concat(strengthBar, "</div>\n        <div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">").concat(strengthTitle, " ").concat(strengthText, "</div>\n      </div>\n    ");
+  };
+
+  Drupal.theme.passwordSuggestions = function (_ref3, tips) {
+    var hasWeaknesses = _ref3.hasWeaknesses;
+    return "<div class=\"password-suggestions\">".concat(tips.length ? "".concat(hasWeaknesses, "<ul class=\"password-suggestions__tips\"><li class=\"password-suggestions__tip\">").concat(tips.join('</li><li class="password-suggestions__tip">'), "</li></ul>") : '', "</div>");
+  };
+})(Drupal);
\ No newline at end of file
diff --git a/core/themes/stable/js/user.theme.es6.js b/core/themes/stable/js/user.theme.es6.js
index 30d0aa9227..9c4f22d6cb 100644
--- a/core/themes/stable/js/user.theme.es6.js
+++ b/core/themes/stable/js/user.theme.es6.js
@@ -11,5 +11,30 @@
    *   A string representing a DOM fragment.
    */
   Drupal.theme.passwordConfirmMessage = translate =>
-    `<div aria-live="polite" aria-atomic="true" class="password-confirm js-password-confirm js-password-confirm-message">${translate.confirmTitle} <span></span></div>`;
+    `<div aria-live="polite" aria-atomic="true" class="password-confirm js-password-confirm js-password-confirm-message" data-drupal-selector="password-confirm-message">${translate.confirmTitle} <span data-drupal-selector="password-match-status-text"></span></div>`;
+
+  /**
+   * Constructs a password strength message.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.strengthTitle
+   *   The title that precedes the strength text.
+   *
+   * @return {string}
+   *   Markup for password strength message.
+   */
+  Drupal.theme.passwordStrength = ({ strengthTitle }) => {
+    const strengthIndicator =
+      '<div class="password-strength__indicator js-password-strength__indicator" data-drupal-selector="password-strength-indicator"></div>';
+    const strengthText =
+      '<span class="password-strength__text js-password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return `
+      <div class="password-strength">
+        <div class="password-strength__meter" data-drupal-selector="password-strength-meter">${strengthIndicator}</div>
+        <div aria-live="polite" aria-atomic="true" class="password-strength__title">${strengthTitle} ${strengthText}</div>
+      </div>
+    `;
+  };
 })(Drupal);
diff --git a/core/themes/stable/js/user.theme.js b/core/themes/stable/js/user.theme.js
index fa8aadefd9..2c76f6f1d2 100644
--- a/core/themes/stable/js/user.theme.js
+++ b/core/themes/stable/js/user.theme.js
@@ -7,6 +7,13 @@
 
 (function (Drupal) {
   Drupal.theme.passwordConfirmMessage = function (translate) {
-    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-confirm js-password-confirm js-password-confirm-message\">".concat(translate.confirmTitle, " <span></span></div>");
+    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-confirm js-password-confirm js-password-confirm-message\" data-drupal-selector=\"password-confirm-message\">".concat(translate.confirmTitle, " <span data-drupal-selector=\"password-match-status-text\"></span></div>");
+  };
+
+  Drupal.theme.passwordStrength = function (_ref) {
+    var strengthTitle = _ref.strengthTitle;
+    var strengthIndicator = '<div class="password-strength__indicator js-password-strength__indicator" data-drupal-selector="password-strength-indicator"></div>';
+    var strengthText = '<span class="password-strength__text js-password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return "\n      <div class=\"password-strength\">\n        <div class=\"password-strength__meter\" data-drupal-selector=\"password-strength-meter\">".concat(strengthIndicator, "</div>\n        <div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">").concat(strengthTitle, " ").concat(strengthText, "</div>\n      </div>\n    ");
   };
 })(Drupal);
\ No newline at end of file
diff --git a/core/themes/stable9/js/user.theme.es6.js b/core/themes/stable9/js/user.theme.es6.js
new file mode 100644
index 0000000000..ba20b55a8d
--- /dev/null
+++ b/core/themes/stable9/js/user.theme.es6.js
@@ -0,0 +1,49 @@
+/**
+ * @file
+ * Stable theme overrides for user password forms.
+ */
+
+(Drupal => {
+  /**
+   * Constructs a password confirm message element.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.confirmTitle
+   *   The translated confirm description that labels the actual confirm text.
+   *
+   * @return {string}
+   *   Markup for the password confirm message.
+   */
+  Drupal.theme.passwordConfirmMessage = ({ confirmTitle }) => {
+    const confirmTextWrapper =
+      '<span data-drupal-selector="password-match-status-text"></span>';
+    return `<div aria-live="polite" aria-atomic="true" class="password-confirm-message js-password-confirm-message" data-drupal-selector="password-confirm-message">${confirmTitle} ${confirmTextWrapper}</div>`;
+  };
+
+  /**
+   * Constructs a password strength message.
+   *
+   * @param {object} passwordSettings
+   *   An object containing password related settings and translated text to
+   *   display.
+   * @param {string} passwordSettings.strengthTitle
+   *   The title that precedes the strength text.
+   *
+   * @return {string}
+   *   Markup for password strength message.
+   */
+  Drupal.theme.passwordStrength = ({ strengthTitle }) => {
+    const strengthIndicator =
+      '<div class="password-strength__indicator js-password-strength__indicator" data-drupal-selector="password-strength-indicator"></div>';
+    const strengthText =
+      '<span class="password-strength__text js-password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return `
+      <div class="password-strength">
+        <div class="password-strength__meter" data-drupal-selector="password-strength-meter">${strengthIndicator}</div>
+        <div aria-live="polite" aria-atomic="true" class="password-strength__title">${strengthTitle} ${strengthText}</div>
+      </div>
+    `;
+  };
+})(Drupal);
diff --git a/core/themes/stable9/js/user.theme.js b/core/themes/stable9/js/user.theme.js
new file mode 100644
index 0000000000..4324b8cc3c
--- /dev/null
+++ b/core/themes/stable9/js/user.theme.js
@@ -0,0 +1,21 @@
+/**
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
+
+(function (Drupal) {
+  Drupal.theme.passwordConfirmMessage = function (_ref) {
+    var confirmTitle = _ref.confirmTitle;
+    var confirmTextWrapper = '<span data-drupal-selector="password-match-status-text"></span>';
+    return "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-confirm-message js-password-confirm-message\" data-drupal-selector=\"password-confirm-message\">".concat(confirmTitle, " ").concat(confirmTextWrapper, "</div>");
+  };
+
+  Drupal.theme.passwordStrength = function (_ref2) {
+    var strengthTitle = _ref2.strengthTitle;
+    var strengthIndicator = '<div class="password-strength__indicator js-password-strength__indicator" data-drupal-selector="password-strength-indicator"></div>';
+    var strengthText = '<span class="password-strength__text js-password-strength__text" data-drupal-selector="password-strength-text"></span>';
+    return "\n      <div class=\"password-strength\">\n        <div class=\"password-strength__meter\" data-drupal-selector=\"password-strength-meter\">".concat(strengthIndicator, "</div>\n        <div aria-live=\"polite\" aria-atomic=\"true\" class=\"password-strength__title\">").concat(strengthTitle, " ").concat(strengthText, "</div>\n      </div>\n    ");
+  };
+})(Drupal);
\ No newline at end of file
