Skip to content

Instantly share code, notes, and snippets.

View kreo's full-sized avatar
:atom:
System Failture. Try again🁢

Fabio Cencetti kreo

:atom:
System Failture. Try again🁢
View GitHub Profile
@kreo
kreo / scss.mjs
Created March 1, 2022 02:04 — forked from p-ob/scss.mjs
import sass from "node-sass";
import fs from "fs";
import process from "process";
import nodeSassImport from "node-sass-import";
import path from "path";
const defaultOpts = {
srcDir: "./src",
outDir: "./dist"
};
@kreo
kreo / SassMeister-input.scss
Created February 18, 2022 08:46 — forked from KittyGiraudel/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
/// Map of breakpoints
/// @type Map
$breakpoints: (
'small': '(min-width: 860px)',
'medium': '(min-width: 1000px)',
const { exec } = require('child_process')
const { promisify } = require('util')
const chalk = require('chalk')
// See: https://docs.npmjs.com/about-audit-reports#severity
const SEVERITY_LEVELS = ['low', 'moderate', 'high', 'critical']
const SEVERITY_THRESHOLD = 'critical'
const run = promisify(exec)
// Get the output of a command. If the command exits with a non-zero code, try
@kreo
kreo / SassMeister-input.scss
Created February 18, 2022 08:43 — forked from KittyGiraudel/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
////
/// String to number converter
/// @author Hugo Giraudel
/// @access private
////
@kreo
kreo / css-ios-pwa-viewport.css
Created January 28, 2022 16:18 — forked from cvan/css-ios-pwa-viewport.css
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
@kreo
kreo / example-input.html
Created July 29, 2021 17:11 — forked from stowball/example-input.html
Fetch a remote SVG as an <img> and convert it to an inline SVG
<img
alt="accessible text"
class="fill-color-red"
height="16"
src="some.svg"
width="16"
onload="fetchSvgInline(this)"
/>
@kreo
kreo / tailwind.config.js
Created July 14, 2021 08:04 — forked from devpato/tailwind.config.js
tailwind.config.js
module.exports = {
prefix: '',
purge: {
content: [
'./src/**/*.{html,ts}',
]
},
darkMode: 'class', // or 'media' or 'class'
theme: {
extend: {},
@kreo
kreo / webpack.config.js
Created July 14, 2021 08:04 — forked from devpato/webpack.config.js
webpack.config.js
const { addTailwindPlugin } = require("@ngneat/tailwind");
const tailwindConfig = require("./tailwind.config.js");
module.exports = (config) => {
addTailwindPlugin({
webpackConfig: config,
tailwindConfig,
patchComponentsStyles: true
});
return config;
@kreo
kreo / get-webpack-alias-from-tsconfig.js
Created July 10, 2021 00:21 — forked from phuctm97/get-webpack-alias-from-tsconfig.js
📎 Get Webpack alias from tsconfig.json, aka. convert tsconfig.json paths to Webpack alias
const path = require('path');
/**
* Helper function infers Webpack aliases from tsconfig.json compilerOptions.baseUrl and
* compilerOptions.paths.
*
* @param {string} tsconfigPath - Path to tsconfig.json (can be either relative or absolute path).
* @return {object} An object representing analogous Webpack alias.
*/
module.exports = (tsconfigPath = './tsconfig.json') => {
@kreo
kreo / css-units-best-practices.md
Created May 28, 2021 15:29 — forked from basham/css-units-best-practices.md
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units