mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-09-27 20:21:59 +02:00
feat: style file inputs using tailwind's file class
This commit is contained in:
parent
f0205ec274
commit
8208ab6785
@ -10,9 +10,15 @@ class Input extends FormComponent
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
$class = 'px-3 py-2 bg-white border-black rounded-lg focus:border-black border-3 focus:ring-castopod ' . $this->class;
|
||||
$baseClass = 'bg-white border-black rounded-lg focus:border-black border-3 focus:ring-castopod focus-within:ring-castopod ' . $this->class;
|
||||
|
||||
$this->attributes['class'] = $class;
|
||||
$this->attributes['class'] = $baseClass;
|
||||
|
||||
if ($this->type === 'file') {
|
||||
$this->attributes['class'] .= ' file:px-3 file:py-2 file:h-[40px] file:font-semibold file:text-gray-800 file:text-sm file:rounded-none file:border-none file:bg-gray-200 file:hover:bg-gray-300 file:cursor-pointer';
|
||||
} else {
|
||||
$this->attributes['class'] .= ' px-3 py-2';
|
||||
}
|
||||
|
||||
if ($this->required) {
|
||||
$this->attributes['required'] = 'required';
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<div class="max-w-2xl px-6 mx-auto">
|
||||
<nav class="py-3">
|
||||
<nav class="mb-2">
|
||||
<a href="<?= route_to('episode', $podcast->handle, $episode->slug) ?>"
|
||||
class="inline-flex items-center px-4 py-2 text-sm focus:ring-castopod"><?= icon(
|
||||
'arrow-left',
|
||||
|
Loading…
Reference in New Issue
Block a user