Skip to content

Instantly share code, notes, and snippets.

View Wolfr's full-sized avatar

Wolfr Wolfr

View GitHub Profile
import pMemoize from 'p-memoize'
import { LanguageKey, TextNodePlainObject } from './types.js'
export const translateAsync = pMemoize(async function (
{ characters, id }: TextNodePlainObject,
languageKey: LanguageKey
) {
// Old Google API
<template>
<nav role="navigation" aria-label="Pagination">
<ul class="c-pagination">
<li class="c-pagination__element">
<Button icon="arrow-left-s" layout="icon-only" :theme='internalPage === 1 ? "inactive" : "secondary"'
@click="decreasePageNumber">Previous page
</Button>
</li>
<li class="c-pagination__element" v-for="(page, index) in pages" :key="page === MORE ? -index : page">
{
"add": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 4C12.5523 4 13 4.44772 13 5V11H19C19.5523 11 20 11.4477 20 12C20 12.5523 19.5523 13 19 13H13V19C13 19.5523 12.5523 20 12 20C11.4477 20 11 19.5523 11 19V13H5C4.44772 13 4 12.5523 4 12C4 11.4477 4.44772 11 5 11H11V5C11 4.44772 11.4477 4 12 4Z\" fill=\"#3F545B\"/></svg>",
"archive": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 5C2 3.89543 2.89543 3 4 3H20C21.1046 3 22 3.89543 22 5V7C22 7.74708 21.5904 8.39848 20.9835 8.74188C20.9944 8.82638 21 8.91253 21 9V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V9C3 8.91253 3.00561 8.82638 3.0165 8.74188C2.40961 8.39848 2 7.74707 2 7V5ZM20 7V5H4V7H20ZM5 9V19H19V9H5ZM8 12C8 11.4477 8.44772 11 9 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H9C8.44772 13 8 12.5523 8 12Z\" fill=\"#3F545B\"/></svg>",
"arrow-down": "<svg width=\"24\" height=\"24\"
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { guidFor } from '@ember/object/internals';
export default class Accordion extends Component {
@tracked isActive = false
accordionId = 'accordion-' + guidFor(this);
@Wolfr
Wolfr / accordion.hbs
Created April 8, 2021 17:35
Accordion in Ember
<div class="auk-accordion {{if this.isActive "auk-accordion--is-active"}}">
<WebComponents::AuButtonLink
@padded="padded-y"
@icon="chevron-right"
@block="true"
{{on "click" this.toggleAccordion}}
aria-expanded={{if this.isActive "true" "false"}}
aria-controls={{this.accordionId}}>{{@label}}
</WebComponents::AuButtonLink>
@Wolfr
Wolfr / global.css
Last active January 17, 2021 18:56
Toolbar
body {
background: red;
}
.st-toolbar {
display: flex;
width: 100%;
justify-content: space-between;
}
import { Component, Element, State, h } from '@stencil/core';
import { hasSlot } from '../../utilities/slot';
/**
* @since 2.0
* @status stable
*
* @slot - The card's body.
* @slot header - The card's header.
* @slot footer - The card's footer.
@-moz-document domain("www.ejustice.just.fgov.be") {
/* Stylesheet to make staatsblad more legible */
frame {
border: none;
}
a {
color: #468FFA;
}
Now using node v12.14.1 (npm v6.13.6)
johanronsse@Johans-iMac spark-backoffice-prototype % npm i
> fsevents@1.2.13 install /Users/johanronsse/Sites/spark-backoffice-prototype/node_modules/glob-watcher/node_modules/fsevents
> node install.js
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
@Wolfr
Wolfr / input.scss
Created September 7, 2020 15:34
Generated by SassMeister.com.
$theme-color: #000;
$theme-name: "|customer-a";
*[data-theme="#{$theme-name}"] button {
color: $theme-color;
}