Browse Source

added markup and css vars;w

master
rdrew 6 months ago
parent
commit
d25a186043
  1. 37
      src/Plugin/Block/LibraryFundraiserBlock.php

37
src/Plugin/Block/LibraryFundraiserBlock.php

@ -22,11 +22,44 @@ class LibraryFundraiserBlock extends BlockBase {
public function build() { public function build() {
$html = ' <style> $html = ' <style>
.libfund_block { .libfund_block {
background: green;
/*=Variables=======================*/
--block-background: #fff;
--block-border: 1px solid #ccc;
--block-padding: 1rem;
--block-margin: 1rem;
--heading-color: init;
--heading-size: 2rem;
--button-color: green;
--text-color: init;
/*=================================*/
display: flex;
flex-direction: column;
align-items: center;
background: var(--block-background);
border: var(--block-border);
margin: var(--block-margin);
padding: var(--block-padding);
h1 {
color: var(--heading-color);
font-size: var(--heading-size);
}
p {
color: var(--text-color);
}
button {
background: var(--button-color);
}
} }
</style> </style>
<div class="libfund_block"> <div class="libfund_block">
<h1 class="test" style=" color: blue; ">It works</h1> <h1 class="test">It works</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<a href="https://library.upei.ca/"><button class="button button1">click me</button></a>
</div>'; </div>';
$build = [ $build = [
'#theme' => 'library_fundraiser_block', '#theme' => 'library_fundraiser_block',

Loading…
Cancel
Save