Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): remove glossy <select> effect in Safari #292

Merged

Conversation

SecondThundeR
Copy link
Contributor

This small CSS fix removes the "glossy" effect of tags in Safari

@SecondThundeR
Copy link
Contributor Author

Before:
image

After:
image

Comment on lines 28 to 30
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if just setting:

Suggested change
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
-webkit-appearance: caret;

wouldn't work?
Setting appearance to none removes the dropdown arrow from all browsers 😞

@SecondThundeR
Copy link
Contributor Author

Unfortunately, option with caret returns that style, I'll try to see what I can do to keep dropdown arrow as well

@SecondThundeR
Copy link
Contributor Author

I have currently found some solution that looks good. By using appearance: none only on the select tag and adding a custom dropdown icon via the background property (I took ChevronRight as a base and rotated it 90 degrees) it solves the original problem and makes the icon itself prettier than the standard browser icon.

The only thing is that there are still cross-browser problems (Now I believe why Safari is called the new IE). Since after appearance: none, the width of select becomes different (on Chrome and Safari the width isn't the same), the width of input in playback controls also breaks. As I understood from some "experiments", because of the grid layout, the min-content parameter in grid-template-columns takes the width of select (as I guess), which is smaller than input and because of this the text in input is cut off.

Of course, in theory, we could add a fixed width select in playback controls, which would eventually make it look almost the same in both browsers.

So I'd like to figure out if I should do such a "hack" for the sake of the great UI, or scrape this idea for now and leave the controls in Safari the way they are (Which of course I wouldn't want to, because the new dropdown icon looks more interesting after all)

Examples of change:
image

image

different sizes of select in both browsers
image

image

@aarthificial
Copy link
Contributor

I think adding a fixed width, or at least a min-width on the selects in the playback controls is a good idea. Right now their size is not really well defined so it's not surprising that it varies between browsers.

@SecondThundeR
Copy link
Contributor Author

After a little poking around, I was able to figure out that the cause of the weird width is also the size property of input, which (again) works differently in both browsers. So I removed it in the PlaybackControls component and added a fixed width for .controls select and input. Now the width looks great in both browsers

image

image

This adds custom dropdown icon and sets appearance to none
Rename background to backround-color as only color has been set for controls
Add more left padding for select for icon to look more centered
Now both controls are looking same on different browsers (Also removed input’s size property to fix this as well)
@aarthificial aarthificial merged commit 9c062b2 into motion-canvas:main Feb 11, 2023
@aarthificial
Copy link
Contributor

Awesome, thanks for the PR!

@SecondThundeR SecondThundeR deleted the remove-glossy-safari-select branch February 11, 2023 15:53
ksassnowski pushed a commit to ksassnowski/kai-video that referenced this pull request Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants