Skip to content

Instantly share code, notes, and snippets.

View MrGrigri's full-sized avatar
🛠️
working hard

Michael Richins MrGrigri

🛠️
working hard
View GitHub Profile
@MrGrigri
MrGrigri / sr-only.css
Created September 12, 2025 22:34
A more feature-rich screen reader only class utility.
@layer utils {
:is(.sr-only, .sr-only-focusable:not(:focus, :focus-within)) {
border: 0 !important;
clip-path: inset(50%) !important;
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
width: 1px !important;
white-space: nowrap !important;
@MrGrigri
MrGrigri / style.css
Last active June 10, 2025 18:15
grid auto-fit and auto-fill
@property --min-inline-size {
syntax: "<length>";
inherits: false;
initial-value: 100px;
}
.container {
display: grid;
grid-template-rows: var(--min-inline-size);
grid-auto-rows: var(--min-inline-size);
@MrGrigri
MrGrigri / konami.service.ts
Last active February 23, 2025 21:41
Angular Konami Service
import { isPlatformBrowser } from '@angular/common';
import {
EventEmitter,
inject,
Injectable,
Output,
PLATFORM_ID,
} from '@angular/core';
@Injectable({ providedIn: 'root' })
@MrGrigri
MrGrigri / README.md
Last active June 10, 2025 17:21
Light Dark Color scheme/palette
@MrGrigri
MrGrigri / new-reset.css
Last active June 19, 2025 17:25
Modern CSS Reset
@layer reset {
:root {
--_body-font-family: var(--reset-body-font-family, sans-serif);
--_heading-font-family: var(--reset-heading-font-family, serif);
--_code-font-family: var(--reset-code-font-family, monospace);
--_text-max-width: var(--reset-text-max-width, 65ch);
--_details-duration: var(--reset-details-duration, 175ms);
--_details-timing: var(--reset-details-timing, ease-out);
@MrGrigri
MrGrigri / README.md
Last active April 23, 2024 16:10
Vanilla JavaScript Router

Simple vanilla JavaScript router

This is a very minimal router to be used in a vanilla JavaScript project. There are only two exposed functions and one options object.

I have used this with a simple ViteJs web server.

Functions

initializeRoutes(routes, options): This function will initialize the routing. A routes object must be passed as well as an optional options object. goToRoute(route): This function is to be called in JavaScript and will navigate to the route.

@MrGrigri
MrGrigri / animated-outline.css
Last active October 19, 2022 23:20
Used to animate the outline offset when an interactive element receives focus only when it's visible.
:root {
--outline-color: #346ebd;
--outline: 2px solid var(--outline-color);
}
* {
outline-offset: -2px;
}
*:not(:active):focus-visible {
@MrGrigri
MrGrigri / HTML Datalist of US States
Last active September 23, 2022 14:26
List of US State in HTML Datalist format. Other list are: territories, federal district, and military shipping areas
<datalist id="us_states">
<option value="al" label="Alabama">Alabama</option>
<option value="ak" label="Alaska">Alaska</option>
<option value="az" label="Arizona">Arizona</option>
<option value="ar" label="Arkansas">Arkansas</option>
<option value="ca" label="California">California</option>
<option value="co" label="Colorado">Colorado</option>
<option value="ct" label="Connecticut">Connecticut</option>
<option value="de" label="Delaware">Delaware</option>
<option value="fl" label="Florida">Florida</option>
@MrGrigri
MrGrigri / uuid.service.ts
Last active July 2, 2019 15:55
Simple Angular UUID management service. This ensures that a UUID is unique to the application by tracking all UUIDs in an app.
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class IdService {
public ids: string[] = [];
constructor() {}
@MrGrigri
MrGrigri / md-color-palette.css
Last active October 23, 2024 02:12
Material Design Color Palette in CSS Variable Form
:root {
--material-color-red: #f44336;
--material-color-red-50: #ffebee;
--material-color-red-100: #ffcdd2;
--material-color-red-200: #ef9a9a;
--material-color-red-300: #e57373;
--material-color-red-400: #ef5350;
--material-color-red-500: var(--material-color-red);
--material-color-red-600: #e53935;
--material-color-red-700: #d32f2f;