filament icon indicating copy to clipboard operation
filament copied to clipboard

Refactor: Use outline instead of ring

Open thethunderturner opened this issue 10 months ago • 3 comments

Description

Closes #13733

Visual changes

none

Functional changes

  • [x] Code style has been fixed by running the composer cs command.
  • [x] Changes have been tested to not break existing functionality.
  • [x] Documentation is up-to-date.

thethunderturner avatar Mar 01 '25 14:03 thethunderturner

Current issue: There are blue borders when focusing on an input. image In packages/support/resources/css/components/input/wrapper.css I found a fix by adding

:focus {
    box-shadow: none !important;
    outline: none !important;
}

which in TW would be written as

:focus {
    @apply shadow-none! outline-none!;
}

However, the TW version doesnt work, and still shows the blue borders. Here is an overview of the generated css Using TW:

.fi-input-wrp :focus {
    --tw-shadow: 0 0 #0000;
    --tw-outline-style: none;
    box-shadow: var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important;
    outline-style: none!important
}

Using native css

.fi-input-wrp :focus {
    box-shadow: none!important;
    outline: none!important
}

thethunderturner avatar Mar 01 '25 15:03 thethunderturner

Part of the migration from ring to outline should be using a consistent outline color. Currently the primary color is used, which is an option, or we default to the browser's accent color as per the default behavior.

This improves current cases of the danger color being used for inputs with validation errors, which in hindsight is suboptimal.

zepfietje avatar Apr 18 '25 06:04 zepfietje

Part of the migration from ring to outline should be using a consistent outline color. Currently the primary color is used, which is an option, or we default to the browser's accent color as per the default behavior.

This improves current cases of the danger color being used for inputs with validation errors, which in hindsight is suboptimal.

Which one do we want to use? primary or browsers default? I think primary should work better because browsers could potentially have different default colors. Let me know if I misunderstood something!

thethunderturner avatar Apr 18 '25 07:04 thethunderturner

I am going to close this as I think there are considerable further steps that need to be taken in order for it to fulfil the intent of the original issue

danharrin avatar Jun 02 '25 12:06 danharrin