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

Input Color - CSS Improvement #3789

Open
abhishek-junghare opened this issue Apr 17, 2024 · 0 comments
Open

Input Color - CSS Improvement #3789

abhishek-junghare opened this issue Apr 17, 2024 · 0 comments

Comments

@abhishek-junghare
Copy link

This is about Bulma | the Docs.

Overview of the problem

The <input class="input" type="color>" could be improved to look better with removed browser added border, padding, outline, etc.

The Left one is with added <style> and the right one is the default look. (Both with Bulma)

image

Steps to Reproduce

This is the default look we get (including Bulma)

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
</head>

<body>
    <input class="input" type="color" value="#f5f5f5">
</body>

</html>

Expected behavior

Added <style> for removing those unnecessary browser CSS rules that could be implemented in Bulma itself.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">

    <style>
        input[type="color"] {
            width: var(--bulma-control-height);
            min-width: var(--bulma-control-height);
            max-width: var(--bulma-control-height);
            margin: 0 !important;
            padding: 0 !important;
            overflow: hidden;
        }
        input[type="color"]::-webkit-color-swatch-wrapper {
            margin: 0 !important;
            padding: 0 !important;
        }
        input[type="color"]::-webkit-color-swatch {
            margin: 0 !important;
            padding: 0 !important;
            border: none;
        }
    </style>

</head>

<body>
    <input class="input" type="color" value="#f5f5f5">
</body>

</html>
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

No branches or pull requests

1 participant