Skip to content

Commit

Permalink
#414986 > improvements and lcp by metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeSimoes committed Dec 29, 2023
1 parent 981df1f commit 5e8000c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion blocks/header/header.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
raqn-header {
margin: var(--scope-margin, 20px);
max-width: var(--scope-max-width, 100%);
}
7 changes: 7 additions & 0 deletions blocks/header/header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import ComponentBase from '../../scripts/component-base.js';
import { eagerImage } from '../../scripts/libs.js';

export default class Header extends ComponentBase {
external = '/header.plain.html';

async processExternal(response) {
await super.processExternal(response);
console.log(this);

Check warning on line 9 in blocks/header/header.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
eagerImage(this, 1);
}
}
4 changes: 2 additions & 2 deletions blocks/navigation/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ raqn-navigation ul li a {
transition: background-color 0.2s ease-in-out;
}

raqn-navigation ul ul {
raqn-navigation div > div > ul > li > ul {
display: none;
position: absolute;
top: 100%;
Expand All @@ -32,6 +32,6 @@ raqn-navigation ul ul {
box-shadow: var(--box-shadow);
}

raqn-navigation ul li:hover > ul {
raqn-navigation div > div > ul > li:hover > ul {
display: block;
}
6 changes: 6 additions & 0 deletions blocks/navigation/navigation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Column from '../column/column.js';

export default class Navigation extends Column {
constructor() {
super();
this.compact = this.getAttribute('compact') || false;
this.icon = this.getAttribute('icon') || 'menu';
console.log('Navigation', this.compact, this.icon);

Check warning on line 8 in blocks/navigation/navigation.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
connected() {

Check failure on line 10 in blocks/navigation/navigation.js

View workflow job for this annotation

GitHub Actions / build

Expected blank line between class members
super.connected();
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/component-loader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { config, getBreakPoint, getBreakPoints } from './libs.js';
import { config, getBreakPoint } from './libs.js';

export default class ComponentLoader {
constructor(blockName, element) {
Expand Down
1 change: 1 addition & 0 deletions scripts/libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const debounce = (func, wait, immediate) => {
};

export const eagerImage = (block, length = 1) => {
console.log(block, block.querySelectorAll('img'));

Check warning on line 45 in scripts/libs.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
const imgs = Array.from(block.querySelectorAll('img')).slice(0, length);
imgs.forEach((img) => {
img.setAttribute('loading', 'eager');
Expand Down
2 changes: 1 addition & 1 deletion styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ img {
}

header {
height: var(--raqn-header-height, 180px);
min-height: var(--raqn-header-height, 160px);
}

@keyframes placeholder {
Expand Down

0 comments on commit 5e8000c

Please sign in to comment.