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

Adding in the CTA button variables. #102

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ templates/.DS_Store
.DS_Store
assets/.DS_Store
.DS_Store
.DS_Store
128 changes: 48 additions & 80 deletions assets/css/blocks/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,22 @@ body .alignfull.is-layout-flow {
margin-block-start: 0px !important;
}

/* Button
/* Button Generall
--------------------------------------------- */

body a.wp-element-button,
body a.wp-block-button__link {
color: var(--wp--preset--color--base);
}

/* CTA Button
--------------------------------------------- */

.wp-block-button.is-style-cta .wp-element-button {
background-color: var(--wp--preset--color--cta);
color: var(--wp--preset--color--base);
border:2px solid var(--wp--custom--colour--cta--800);
border: var(--wp--custom--button--cta--border--width) var(--wp--custom--button--cta--border--style) var(--wp--custom--button--cta--border--color);
}

.wp-block-button.is-style-cta .wp-element-button:after{
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='29' viewBox='0 0 28 29' fill='none'%3E%3Ccircle cx='14.5' cy='15' r='12' stroke='white' stroke-width='2'/%3E%3Cpath d='M13.4887 11.0045L16.3617 13.7766H9.41327C8.90717 13.7766 8.5 14.1863 8.5 14.6956V15.3082C8.5 15.8175 8.90717 16.2272 9.41327 16.2272H16.3617L13.4887 18.9994C13.1196 19.3555 13.112 19.9489 13.4735 20.3127L13.8921 20.7301C14.2498 21.09 14.8282 21.09 15.1821 20.7301L20.2317 15.6528C20.5894 15.2929 20.5894 14.7109 20.2317 14.3548L15.1821 9.26994C14.8244 8.91002 14.246 8.91002 13.8921 9.26994L13.4735 9.6873C13.112 10.0549 13.1196 10.6484 13.4887 11.0045Z' fill='white'/%3E%3C/svg%3E");
stroke: #fff !important;
Expand All @@ -54,7 +56,7 @@ body a.wp-block-button__link {
}
.wp-block-button .has-cta-background-color {
color: var(--wp--preset--color--base);
border:2px solid var(--wp--custom--colour--cta--800);
border: var(--wp--custom--button--cta--border--width) var(--wp--custom--button--cta--border--style) var(--wp--custom--button--cta--border--color);
}
.wp-block-button .has-cta-background-color:after{
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='29' viewBox='0 0 28 29' fill='none'%3E%3Ccircle cx='14.5' cy='15' r='12' stroke='white' stroke-width='2'/%3E%3Cpath d='M13.4887 11.0045L16.3617 13.7766H9.41327C8.90717 13.7766 8.5 14.1863 8.5 14.6956V15.3082C8.5 15.8175 8.90717 16.2272 9.41327 16.2272H16.3617L13.4887 18.9994C13.1196 19.3555 13.112 19.9489 13.4735 20.3127L13.8921 20.7301C14.2498 21.09 14.8282 21.09 15.1821 20.7301L20.2317 15.6528C20.5894 15.2929 20.5894 14.7109 20.2317 14.3548L15.1821 9.26994C14.8244 8.91002 14.246 8.91002 13.8921 9.26994L13.4735 9.6873C13.112 10.0549 13.1196 10.6484 13.4887 11.0045Z' fill='white'/%3E%3C/svg%3E");
Expand All @@ -71,14 +73,19 @@ body a.wp-block-button__link {
margin-left: 6px;
margin-top:-5px;
vertical-align: middle;
}
}

.wp-block-button.is-style-outline .has-cta-color.has-base-background-color::after{
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='29' viewBox='0 0 28 29' fill='none'%3E%3Ccircle cx='14.5' cy='15' r='12' stroke='currentColor' stroke-width='2'/%3E%3Cpath d='M13.4887 11.0045L16.3617 13.7766H9.41327C8.90717 13.7766 8.5 14.1863 8.5 14.6956V15.3082C8.5 15.8175 8.90717 16.2272 9.41327 16.2272H16.3617L13.4887 18.9994C13.1196 19.3555 13.112 19.9489 13.4735 20.3127L13.8921 20.7301C14.2498 21.09 14.8282 21.09 15.1821 20.7301L20.2317 15.6528C20.5894 15.2929 20.5894 14.7109 20.2317 14.3548L15.1821 9.26994C14.8244 8.91002 14.246 8.91002 13.8921 9.26994L13.4735 9.6873C13.112 10.0549 13.1196 10.6484 13.4887 11.0045Z' fill='currentColor'/%3E%3C/svg%3E");
stroke: var(--wp--preset--color--cta) !important;
fill: var(--wp--preset--color--cta) !important;
filter: var(--wp--preset--color--cta) !important;
}


/* Other Buttons
--------------------------------------------- */

.wp-block-button.is-style-outline .has-cta-color.has-base-background-color::after{
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='29' viewBox='0 0 28 29' fill='none'%3E%3Ccircle cx='14.5' cy='15' r='12' stroke='currentColor' stroke-width='2'/%3E%3Cpath d='M13.4887 11.0045L16.3617 13.7766H9.41327C8.90717 13.7766 8.5 14.1863 8.5 14.6956V15.3082C8.5 15.8175 8.90717 16.2272 9.41327 16.2272H16.3617L13.4887 18.9994C13.1196 19.3555 13.112 19.9489 13.4735 20.3127L13.8921 20.7301C14.2498 21.09 14.8282 21.09 15.1821 20.7301L20.2317 15.6528C20.5894 15.2929 20.5894 14.7109 20.2317 14.3548L15.1821 9.26994C14.8244 8.91002 14.246 8.91002 13.8921 9.26994L13.4735 9.6873C13.112 10.0549 13.1196 10.6484 13.4887 11.0045Z' fill='currentColor'/%3E%3C/svg%3E");
stroke: var(--wp--preset--color--cta) !important;
fill: var(--wp--preset--color--cta) !important;
filter: var(--wp--preset--color--cta) !important;
}
.wp-block-button .has-primary-background-color {
color: var(--wp--preset--color--base);
border:2px solid var(--wp--custom--colour--primary--800);
Expand All @@ -104,7 +111,10 @@ vertical-align: middle;
border:2px solid var(--wp--custom--colour--secondary--800);
color:var(--wp--custom--colour--secondary--800);
}

.wp-block-button .has-secondary-background-color:after{
stroke: #fff !important;
fill: #fff !important;
}
.wp-block-button .has-tertiary-background-color {
color: var(--wp--preset--color--base);
border:2px solid var(--wp--custom--colour--tertiary--800);
Expand Down Expand Up @@ -236,14 +246,16 @@ vertical-align: middle;
border: 2px solid;
border-color: currentColor;
}

.wp-block-button.is-style-outline-shadow .wp-element-button {
background-color: transparent;
border: 2px solid;
color: #000;
border-color: #000;
}

.wp-block-button.is-style-outline .wp-element-button.has-cta-color:hover{
background-color: var(--wp--custom--colour--cta--100) !important;
background-color: var( --wp--custom--button--cta--hover--border--color ) !important;
border-color: var(--wp--preset--color--cta) !important;
box-shadow: 0px 2px var(--wp--preset--color--cta);
-webkit-box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--preset--color--cta),0 var(--animation-depth,.275em) 0 0 var(--wp--preset--color--cta);
Expand All @@ -252,9 +264,10 @@ vertical-align: middle;
-ms-transform: translateY(calc(-1*var(--animation-depth, .275em)));
transform: translateY(calc(-1*var(--animation-depth, .275em)));
}

.wp-block-button.is-style-outline .wp-element-button.has-cta-color:focus{
background-color: var(--wp--preset--color--cta) !important;
border-color: var(--wp--custom--colour--cta--300) !important;
border-color: var( --wp--custom--button--cta--focus--border--color ) !important;
box-shadow: 0px 0px var(--wp--preset--color--cta);
color:#fff!important;
}
Expand All @@ -263,9 +276,6 @@ vertical-align: middle;
border-color: var(--wp--preset--color--cta) !important;
box-shadow: 0px 2px var(--wp--preset--color--cta);
color:var(--wp--preset--color--cta) !important;
-webkit-transform: translateY(calc(-1*var(--animation-depth, .075em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .075em)));
transform: translateY(calc(-1*var(--animation-depth, .075em)));
}
.wp-block-button.is-style-outline .wp-element-button.has-primary-color:active{
background-color: #fff !important;
Expand Down Expand Up @@ -313,6 +323,7 @@ vertical-align: middle;
color: var(--wp--preset--color--base);
border: 2px solid var(--wp--custom--colour--primary--800);
}

.wp-block-button.is-style-outline-shadow .wp-element-button.has-secondary-color {
box-shadow: 5px 5px var(--wp--custom--colour--secondary--800);
border: 2px solid var(--wp--preset--color--secondary);
Expand Down Expand Up @@ -340,6 +351,7 @@ vertical-align: middle;
.wp-block-button .has-primary-background-color:hover {
background-color: var(--wp--custom--colour--cta--600) !important;
}

.wp-block-button.is-style-outline-shadow .has-primary-color:hover {
background-color: var(--wp--preset--color--primary) !important;
color: var(--wp--preset--color--base) !important;
Expand Down Expand Up @@ -369,45 +381,42 @@ vertical-align: middle;
.wp-block-button.is-style-cta .wp-element-button:hover,
.wp-block-button .has-cta-background-color:hover,
.wp-block-button.is-style-pill .has-cta-background-color:hover {
background-color: var(--wp--custom--colour--cta--600) !important;
border-color: var(--wp--custom--colour--cta--800) !important;
-webkit-box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--colour--cta--800),0 var(--animation-depth,.275em) 0 0 var(--wp--custom--colour--cta--800);
box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--colour--cta--800),0 var(--animation-depth,.275em) 0 0 var(--wp--custom--colour--cta--800);
background-color: var( --wp--custom--button--cta--hover--background--color ) !important;
border-color: var( --wp--custom--button--cta--hover--border--color ) !important;
-webkit-box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--button--cta--hover--shadow--color),0 var(--animation-depth,.275em) 0 0 var(--wp--custom--button--cta--hover--shadow--color);
box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--button--cta--hover--shadow--color),0 var(--animation-depth,.275em) 0 0 var(--wp--custom--button--cta--hover--shadow--color);
-webkit-transform: translateY(calc(-1*var(--animation-depth, .275em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .275em)));
transform: translateY(calc(-1*var(--animation-depth, .275em)));
}
.wp-block-button.is-style-cta .wp-element-button:active,
.wp-block-button .has-cta-background-color:active,
.wp-block-button.is-style-pill .has-cta-background-color:active {
background-color: var(--wp--custom--colour--cta--600) !important;
border-color: var(--wp--custom--colour--cta--800) !important;
box-shadow: 0px 2px var(--wp--custom--colour--cta--800);
-webkit-transform: translateY(calc(-1*var(--animation-depth, .075em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .075em)));
transform: translateY(calc(-1*var(--animation-depth, .075em)));
background-color: var(--wp--custom--button--cta--active--background--color) !important;
border-color: var(--wp--custom--button--cta--active--border--color) !important;
box-shadow: 0px 2px var(--wp--custom--button--cta--active--shadow--color);
}
.wp-block-button.is-style-cta .wp-element-button:focus,
.wp-block-button .has-cta-background-color:focus,
.wp-block-button.is-style-pill .has-cta-background-color:focus {
background-color: var(--wp--custom--colour--cta--400) !important;
border-color: var(--wp--custom--colour--cta--300) !important;
box-shadow: 0px 0px var(--wp--custom--colour--cta--800);
background-color: var(--wp--custom--button--cta--focus--background--color) !important;
border-color: var(--wp--custom--button--cta--focus--border--color) !important;
box-shadow: 0px 0px var(--wp--custom--button--cta--focus--shadow--color);
}

/* CTA Style outline */
.wp-block-button.is-style-outline .has-cta-color:hover,
.wp-block-button.is-style-pill-outline .has-cta-color:hover {
background-color: var(--wp--custom--colour--cta--100) !important;
border-color: var(--wp--preset--color--cta) !important;
background-color: var( --wp--custom--button--cta--hover--background-color ) !important;
border-color: var( --wp--preset--color--cta ) !important;
color:var(--wp--preset--color--cta) !important;
-webkit-box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--preset--color--cta),0 var(--animation-depth,.275em) 0 0 var(--wp--preset--color--cta);
box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--preset--color--cta),0 var(--animation-depth,.275em) 0 0 var(--wp--preset--color--cta);
-webkit-transform: translateY(calc(-1*var(--animation-depth, .275em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .275em)));
transform: translateY(calc(-1*var(--animation-depth, .275em)));

}

.wp-block-button.is-style-outline .has-cta-color:focus,
.wp-block-button.is-style-pill-outline .has-cta-color:focus {
border-color: var(--wp--custom--colour--cta--700) !important;
Expand All @@ -419,9 +428,6 @@ vertical-align: middle;
border-color: var(--wp--preset--color--cta) !important;
box-shadow: 0px 2px var(--wp--preset--color--cta);
color: var(--wp--preset--color--cta) !important;
-webkit-transform: translateY(calc(-1*var(--animation-depth, .075em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .075em)));
transform: translateY(calc(-1*var(--animation-depth, .075em)));
}

/* CTA Others */
Expand All @@ -437,6 +443,7 @@ vertical-align: middle;
color: var(--wp--preset--color--base) !important;
}


.wp-element-button.has-primary-background-color:hover {
background-color: var(--wp--custom--colour--primary--600) !important;
border: 2px solid var(--wp--custom--colour--primary--800);
Expand Down Expand Up @@ -579,72 +586,33 @@ vertical-align: middle;


.wp-block-button.is-style-outline-shadow .has-cta-color:active {
box-shadow: 0px 2px var(--wp--custom--colour--cta--800) !important;
box-shadow: 2px 2px var( --wp--custom--button--cta--active-shadow-color ) !important;
top: 3px;
transition: 0.1s;
position: relative;
}
.wp-block-button.is-style-outline-shadow .has-primary-color:active {
box-shadow: 0px 2px var(--wp--custom--colour--primary--800) !important;
box-shadow: 2px 2px var(--wp--custom--colour--primary--800) !important;
top: 3px;
transition: 0.1s;
position: relative;
}
.wp-block-button.is-style-outline-shadow .has-secondary-color:active {
box-shadow: 0px 2px var(--wp--custom--colour--secondary--800) !important;
box-shadow: 2px 2px var(--wp--custom--colour--secondary--800) !important;
top: 3px;
transition: 0.1s;
position: relative;
}
.wp-block-button.is-style-outline-shadow .has-tertiary-color:active {
box-shadow: 0px 2px var(--wp--custom--colour--tertiary--800) !important;
box-shadow: 2px 2px var(--wp--custom--colour--tertiary--800) !important;
top: 3px;
transition: 0.1s;
position: relative;
}

.wp-block-button.is-style-shadow .wp-element-button:active {
box-shadow: 0px 2px var(--wp--preset--color--contrast) !important;
box-shadow: 2px 2px var(--wp--preset--color--contrast) !important;
top: 3px;
transition: 0.1s;
position: relative;
}

/* Contrast Backgrounds */
.has-contrast-background-color .wp-block-button.is-style-cta .wp-element-button, .has-contrast-background-color .wp-block-button .has-cta-background-color{
border: 2px solid var(--wp--custom--colour--cta--300)!important;
}
.has-contrast-background-color .wp-block-button.is-style-shadow .wp-element-button{
box-shadow:5px 5px var(--wp--custom--colour--base--500);
}

.has-contrast-background-color .wp-block-button.is-style-shadow .wp-element-button:active{
box-shadow:0px 2px var(--wp--custom--colour--base--500)!important;
}

.has-contrast-background-color .wp-block-button.is-style-cta .wp-element-button:hover, .has-contrast-background-color .wp-block-button .has-cta-background-color:hover, .has-contrast-background-color .wp-block-button.is-style-pill .has-cta-background-color:hover{ background-color: var(--wp--custom--colour--cta--600) !important;
border-color: var(--wp--custom--colour--cta--300) !important;
-webkit-box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--colour--cta--300),0 var(--animation-depth,.275em) 0 0 var(--wp--custom--colour--cta--300);
box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--colour--cta--300),0 var(--animation-depth,.275em) 0 0 var(--wp--custom--colour--cta--300);
-webkit-transform: translateY(calc(-1*var(--animation-depth, .275em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .275em)));
transform: translateY(calc(-1*var(--animation-depth, .275em)));
}

.has-contrast-background-color .wp-block-button.is-style-cta .wp-element-button:active, .has-contrast-background-color .wp-block-button .has-cta-background-color:active, .has-contrast-background-color .wp-block-button.is-style-pill .has-cta-background-color:active{
background-color: var(--wp--custom--colour--cta--600) !important;
border-color: var(--wp--custom--colour--cta--300) !important;
-webkit-box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--colour--cta--300),0 var(--animation-depth,.075em) 0 0 var(--wp--custom--colour--cta--300);
box-shadow: 0 0 0 var(--cta-stroke-width,0) var(--wp--custom--colour--cta--300),0 var(--animation-depth,.075em) 0 0 var(--wp--custom--colour--cta--300);
-webkit-transform: translateY(calc(-1*var(--animation-depth, .075em)));
-ms-transform: translateY(calc(-1*var(--animation-depth, .075em)));
transform: translateY(calc(-1*var(--animation-depth, .075em)));
}

.has-contrast-background-color .wp-block-button.is-style-outline-shadow .wp-element-button.has-cta-color{
box-shadow: 5px 5px var(--wp--custom--colour--cta--300);
}

.has-contrast-background-color .wp-block-button.is-style-outline-shadow .has-cta-color:active {
box-shadow: 0px 2px var(--wp--custom--colour--cta--300)!important;
}
Loading
Loading