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

::after pseudo-element is not shown #23062

Open
CYBAI opened this issue Mar 20, 2019 · 0 comments
Open

::after pseudo-element is not shown #23062

CYBAI opened this issue Mar 20, 2019 · 0 comments

Comments

@CYBAI
Copy link
Member

CYBAI commented Mar 20, 2019

We can click the checkbox to change the style of the div but we cannot see the circle created by ::after on Servo.

圖片

<style>
input[type=checkbox]:enabled:checked + div {
    background-color: #0b2b50;
}

div {
    width: 36px;
    height: 20px;
    position: relative;
    background-color: #fafafa;
    border: #e6e6e6 solid 1px;
    border-radius: 19px;
    content: '';
    display: block;
    visibility: visible;
}

input[type=checkbox]:checked + div::after {
    left: 18px;
}

input[type=checkbox]:enabled + div::after {
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.1);
}

div::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 100%;
    content: '';
    display: block;
    transition: left 0.15s ease-out, box-shadow 0.15s ease-in-out;
    visibility: visible;
}
</style>

<input type="checkbox" checked />
<div></div>

cc @emilio

Tested with master (5cfc434) on macOS 10.14.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant