Skip to content

Commit

Permalink
Add support for accent color in Blockcore Explorer
Browse files Browse the repository at this point in the history
- Add support for the new chain color option.
- This does remove the alpha channel for the header accent underline, so no longer transparent.
- Closes #10
  • Loading branch information
sondreb committed May 14, 2020
1 parent 45ae5be commit 8ebb9e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Observable, BehaviorSubject, Subject } from 'rxjs';
import { Router, NavigationStart } from '@angular/router';
import { filter } from 'rxjs/operators';


@Injectable({
providedIn: 'root'
})
Expand Down Expand Up @@ -44,10 +43,6 @@ export class SetupService {
private router: Router
) {

// this.getChains();
// this.setChain('blockcore');
// await this.setChain('BLOCKCORE');

}

async getChains() {
Expand Down Expand Up @@ -80,6 +75,10 @@ export class SetupService {
// Update the chain subject, which should trigger consumers to do some processing.
this.current = chain;

if (this.Chain?.Color) {
document.documentElement.style.setProperty('--accent', this.Chain?.Color);
}

return null;
}

Expand Down
5 changes: 3 additions & 2 deletions src/Blockcore.Explorer/ClientApp/src/styles/blockcore.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ a:hover {
position: absolute;
content: "";
height: 0.2em;
bottom: 0.2em;
bottom: 0.16em;
margin: 0 auto;
left: 0;
right: 0;
width: 100%;
background: RGBA(243, 182, 35, 0.72);
/* background: RGBA(243, 182, 35,1);*/
background: var(--accent);
}

.loading-text {
Expand Down

0 comments on commit 8ebb9e6

Please sign in to comment.