Skip to content

Instantly share code, notes, and snippets.

@alvarotf
alvarotf / tailwindcss.config.pixels.js
Created December 21, 2020 10:22
Default Tailwind CSS theme config in pixels. Made to use with 'extend', this is not the full config, only sections that had rem units in them. https://tailwindcss.com/docs/configuration#theme
const remToPx = (rem, base = 16) => `${rem * base}px`
const theme = {
theme: {
spacing: {
px: '1px',
0: '0px',
0.5: remToPx(0.125),
1: remToPx(0.25),
1.5: remToPx(0.375),
2: remToPx(0.5),
@alvarotf
alvarotf / async-api-call-helper.service.ts
Created December 22, 2018 21:07
Angular Universal: Using ZoneMacroTaskWrapper to make renderModuleFactory wait for async api calls.
import { Injectable } from '@angular/core';
import { Observable, Observer, Subscription } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class AsyncApiCallHelperService {