Skip to content
Open
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ Proporciona una manera sencilla de indentificar que se está navegando en una we
Para integrar esta herramienta en un proyecto, copie el siguiente código y coloquelo en el archivo del index.html de su proyecto.

```html
<script src="https://cdn.jsdelivr.net/gh/ogticrd/official-header/main.js" defer></script>
<script
id="official-header"
src="https://cdn.jsdelivr.net/gh/ogticrd/official-header/main.js"
defer
></script>
```

En caso de desear utilizar el tema dark, basta con cambiar la importación del script por:

```html
<script
id="official-header"
src="https://cdn.jsdelivr.net/gh/ogticrd/official-header/main.js"
defer
theme="dark"
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class GovernmentOfficialHeader extends HTMLElement {
constructor() {
const theme =
(document.currentScript &&
document.currentScript.getAttribute("theme")) ||
(document.getElementById("official-header") &&
document.getElementById("official-header").getAttribute("theme")) ||
"light";
super();
const template = document.createElement("template");
Expand Down