Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 0169acc

Browse files
committed
Tweak password input styling
1 parent fd6fa9c commit 0169acc

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

resources/sass/utils/_addon.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@
100100
@apply border-l-0;
101101
}
102102

103+
.input-error + .password-toggle {
104+
@apply border-red-300;
105+
}
106+
103107
.has-leading-addon {
104108
@apply rounded-none;
105109
@apply rounded-r-md;

resources/sass/utils/_form-group.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141

4242
&:focus {
4343
@apply border-red-300;
44-
@apply shadow-outline-red;
44+
45+
&:not(.password-toggleable) {
46+
@apply shadow-outline-red;
47+
}
4548
}
4649

4750
&::placeholder {

resources/sass/utils/_input.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424

2525
&:focus {
2626
@apply shadow-none;
27-
@apply border;
28-
border-color: #d2d6dc;
2927
@apply border-r-0;
28+
29+
&:not(.input-error) + .password-toggle {
30+
@apply border-blue-300;
31+
}
3032
}
3133
}

src/Components/Inputs/Password.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ public function inputClass(): string
6060

6161
public function containerClass(): string
6262
{
63+
$shadowColor = $this->hasErrorsAndShow($this->name)
64+
? 'red'
65+
: 'blue';
66+
6367
return collect([
6468
'form-text-container',
6569
$this->maxWidth,
66-
$this->showToggle ? 'focus-within:shadow-outline-blue rounded-md' : null,
70+
$this->showToggle ? "focus-within:shadow-outline-{$shadowColor} rounded-md" : null,
6771
])->filter()->implode(' ');
6872
}
6973
}

0 commit comments

Comments
 (0)