app/components/big-color-border-button.css (56 lines of code) (raw):
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
button.color-border {
background: none;
border: 0;
box-sizing: border-box;
margin: 1em;
padding: 2em 4em;
box-shadow: inset 0 0 0 2px #000000;
color: #000000;
font-size: inherit;
font-weight: 700;
position: relative;
vertical-align: middle;
}
button.color-border::before,
button.color-border::after {
box-sizing: inherit;
content: "";
position: absolute;
width: 100%;
height: 100%;
}
button.color-border.draw {
transition: color 1s;
}
button.color-border.draw::before,
button.color-border.draw::after {
border: 8px solid transparent;
width: 0;
height: 0;
}
button.color-border.draw::before {
top: 0;
left: 0;
}
button.color-border.draw::after {
bottom: 0;
right: 0;
}
button.color-border.draw:hover {
color: var(--google-cloud-blue);
}
button.color-border.draw:hover::before,
button.color-border.draw:hover::after {
width: 100%;
height: 100%;
}
button.color-border.draw:hover::before {
border-top-color: var(--google-cloud-red);
border-right-color: var(--google-cloud-blue);
transition: width 0.25s ease-out, height 0.25s ease-out 0.25s;
}
button.color-border.draw:hover::after {
border-bottom-color: var(--google-cloud-green);
border-left-color: var(--google-cloud-yellow);
transition: border-color 0s ease-out 0.5s, width 0.25s ease-out 0.5s, height 0.25s ease-out 0.75s;
}