Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored and astrobot-houston committed Jul 28, 2023
1 parent 1e0cd11 commit 90141e9
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions docs/src/components/icons-list.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ const icons = Object.keys(Icons) as (keyof typeof Icons)[];
</div>

<script>
const icons = document.querySelectorAll('.icon-preview');
icons.forEach((icon) => {
icon.addEventListener('click', () => {
const iconName = icon.dataset.name;
const copiedValue = `<Icon name="${iconName}" />`;
navigator.clipboard.writeText(copiedValue);
const icons = document.querySelectorAll('.icon-preview');
icons.forEach((icon) => {
icon.addEventListener('click', () => {
const iconName = icon.dataset.name;
const copiedValue = `<Icon name="${iconName}" />`;
navigator.clipboard.writeText(copiedValue);

const iconLabel = icon.querySelector('[aria-live]');
if (iconLabel) {
iconLabel.textContent = 'Copied!';
setTimeout(() => {
iconLabel.textContent = iconName;
}, 1000);
}
});
});
const iconLabel = icon.querySelector('[aria-live]');
if (iconLabel) {
iconLabel.textContent = 'Copied!';
setTimeout(() => {
iconLabel.textContent = iconName;
}, 1000);
}
});
});
</script>

<style>
Expand All @@ -58,7 +58,8 @@ const icons = Object.keys(Icons) as (keyof typeof Icons)[];
background: none;
}

.icon-preview:hover, .icon-preview:focus {
.icon-preview:hover,
.icon-preview:focus {
cursor: pointer;
border: 1px solid var(--sl-color-gray-3);
background: var(--sl-color-gray-7, var(--sl-color-gray-6));
Expand Down

0 comments on commit 90141e9

Please sign in to comment.