My problem is a behavior that is happening only in Chrome (Not in mozilla) and it happens when I link the css, so if I use a style tag I got what I expected.
The problem is when I use a transition in a linked stylesheet, the element, when loaded, fade from white or black to the defined color.. Which is really weird as you can see below :
And what I expect :
Here is a simple code to demonstrate my problem :
index.html :
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<aside>
<form>
<input type="text" name="pseudo" id="reg-pseudo" class="text-left"/><br/>
<input type="checkbox" name="rememberme" id="rememberme" class="hidden"/>
<label for="rememberme" class="checkbox float-left"></label>
</form>
</aside>
</body>
style.css :
aside input:focus {
border-color: #5FAACF;
}
aside input, aside .checkbox {
border-color: #a18bb9;
color: #333;
font-weight: bolder;
background-color: white;
border-width: 4px;
border-style: solid;
border-radius: 4px;
outline: none;
transition: border-color 0.5s ease-in-out;
}
aside .checkbox {
width: 14px;
height: 14px;
margin: 2px 4px;
display: inline-block;
}
aside input[type=checkbox]:checked + .checkbox {
border-color: #cf5f9b;
}
aside input[type=checkbox]:checked + .checkbox:before {
content: "✔";
top: -4px;
position: relative;
display: inline;
}
.hidden {
visibility: none;
width: 0;
}
And here is a working fiddle of what I would like (because as I explained the css is not linked but in a style tag)
This wasn't happening before, so I would like to know if there is a way to solve this whitout using the style tag and whitout using delays, if I'm doing something wrong here or if it's just a passenger chrome bug ? Thanks
I found a similar issue here but I'm not satisified with the answers