Initial public commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'defaults' => [
|
||||
'text' => 'Learn more',
|
||||
'label' => false,
|
||||
'link' => url(),
|
||||
'modifiers' => [],
|
||||
'class' => false
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
if(!is_array($modifiers)) $modifiers = [$modifiers];
|
||||
$modifiers = array_map(function($modifier) {
|
||||
return 'button--' . $modifier;
|
||||
}, $modifiers);
|
||||
$modifiers = implode(' ', $modifiers);
|
||||
|
||||
$classes = 'button' . r($modifiers, ' ' . $modifiers) . r($class, ' ' . $class);
|
||||
|
||||
?>
|
||||
<a href="<?= $link ?>" class="<?= $classes ?>"<?php if($label): ?> aria-label="<?= $label ?>"<?php endif ?>><?= $text ?></a>
|
||||
@@ -0,0 +1,45 @@
|
||||
.button {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
|
||||
font: inherit;
|
||||
line-height: inherit;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
|
||||
padding: 0.3em 0.5em 0.2em;
|
||||
border: 1px solid $color--brand-primary;
|
||||
border-radius: -cdd-em(4);
|
||||
|
||||
& + & {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
transition: color 0.2s ease, border-color 0.2s ease;
|
||||
|
||||
&, &:link, &:visited {
|
||||
color: $color--brand-primary;
|
||||
}
|
||||
|
||||
&:hover, &:focus, &:not(&--novisited):visited {
|
||||
border-color: $color--brand-primary-alternate;
|
||||
color: $color--brand-primary-alternate;
|
||||
}
|
||||
|
||||
&--secondary {
|
||||
&, &:link, &:visited {
|
||||
border-color: $color--brand-secondary;
|
||||
color: $color--brand-secondary;
|
||||
}
|
||||
|
||||
&:hover, &:focus, &:not(.button--novisited):visited {
|
||||
border-color: $color--brand-secondary-alternate;
|
||||
color: $color--brand-secondary-alternate;
|
||||
}
|
||||
}
|
||||
|
||||
&:disabled, &--disabled {
|
||||
border-color: $color--passive-dark;
|
||||
color: $color--passive-dark;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user