Remove iOS input shadow
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
Safari on iOS applies native styling to form controls, and one visible side effect is the default inner shadow or glossy look on text inputs. If your design uses flat inputs, rounded fields, or custom borders, that platform styling can clash with the rest of the UI. The fix is usually to remove the native appearance and then restyle the input explicitly.
Why the Shadow Appears on iOS
On iPhone and iPad browsers, many form controls are rendered with WebKit-specific defaults rather than with only your CSS declarations. Even if you set border-radius, border, and background-color, the browser may still keep the built-in control appearance.
That is why an input can look correct on desktop Chrome but still show an inset shadow on mobile Safari.
Use appearance and box-shadow
The standard starting point is to remove native appearance and shadow together.
This works for many common text fields. -webkit-appearance: none tells iOS Safari to stop drawing the platform-specific control skin, and box-shadow: none clears any remaining CSS shadow.
Full Example for a Flat Input Style
A complete reset often looks like this:
The focus state is intentionally reintroduced with your own shadow so the field still looks interactive after the iOS default styling is removed.
Special Case: Search Inputs and Other Input Types
Some input types carry extra platform behavior. For example, type="search" on iOS may apply special styling and built-in controls. If you still see native rendering artifacts, reset the input more aggressively or switch to type="text" if the semantic difference is not required.
That is often enough to remove the rounded native search chrome and inner shadow.
Test the Real Device, Not Only the Simulator
This kind of issue is easy to misjudge in desktop browser emulation. The safest validation is:
- test on a real iPhone or iPad if possible
- compare Safari and in-app web views if your app uses both
- test focus, placeholder text, and autofill states
iOS can render focused, autofilled, and disabled controls differently, so the shadow may seem gone until another control state appears.
Do Not Remove Styling Without Replacing Usability
Removing native appearance is not purely cosmetic. Once you neutralize the built-in look, you also take responsibility for focus visibility, borders, contrast, and touch-target clarity. Flat inputs that match the design but have weak focus indication are a usability regression.
That is why the best fix is not only "remove the shadow". It is "remove the shadow and replace the field styling with a consistent accessible design".
Common Pitfalls
- Removing the default shadow but forgetting to add a visible custom focus state.
- Testing only on desktop emulation instead of real iOS Safari.
- Resetting
appearanceon one input type but not others such assearchortextarea. - Assuming the shadow comes from your CSS when it is actually native WebKit styling.
- Using very small font sizes and triggering mobile form quirks unrelated to the shadow itself.
Summary
- iOS Safari often applies native input styling that includes an inner shadow.
- The main fix is
-webkit-appearance: noneplus explicit custom styling. - '
box-shadow: noneremoves leftover CSS shadow, but native appearance usually needs to be disabled too.' - Some input types such as search fields need extra attention.
- After removing the default look, add your own focus and interaction styling so the control stays usable.
Related reading
- Remove last item from array
- Removing input background colour for Chrome autocomplete?
- Rendering Plaintext as HTML maintaining whitespace – without pre
- Repeat a string in JavaScript a number of times
- Remove last character from string. Swift language
- Remove or uninstall library previously added cocoapods
- Repeatedly prompt user until resolved using nodeJS async-await
- Replace an image with Ajax on seaside
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.