Skip to content

Instantly share code, notes, and snippets.

View saltnpixels's full-sized avatar

Eric saltnpixels

View GitHub Profile
@saltnpixels
saltnpixels / base-layout.css
Last active April 28, 2021 16:29
CSS Base Layout
html {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 62.5%;
}
body {
font-size: 1.6rem;
-webkit-font-smoothing: antialiased;
:root {
--fs-base: 1.6rem;
--fs-m: 1.8rem;
--fs-s: 1.4rem;
}
p {
margin: 1rem 0 0 0;
}
@saltnpixels
saltnpixels / containers.css
Created April 28, 2021 20:17
WordPress Containers CSS
/*------- Three types of Containers --------*/
.container {
margin: auto;
max-width: var(--container);
padding-left: var(--container-padding);
padding-right: var(--container-padding);
width: 100%;
}
.container-fluid {
@saltnpixels
saltnpixels / svg_allowed_html
Last active May 10, 2021 19:22
Get SVG File in php
function get_svg_allowed_html() {
$allowed_html = [
'svg' => [
'fill' => true,
'height' => true,
'width' => true,
'xmlns' => true,
'viewbox' => true,
'class' => true,
'transform' => true,
@saltnpixels
saltnpixels / button-arrow.svg
Last active May 12, 2021 17:22
svg Animate from within
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saltnpixels
saltnpixels / entry-content.css
Created June 2, 2021 18:36
Centered Content for WP Blocks
.entry-content,
.article-footer,
.after-article {
padding-left: var(--spacing-20);
padding-right: var(--spacing-20);
&::after {
clear: both;
content: "";
}
if ( ! function_exists( 'set_tag_cloud_sizes' ) ) {
/**
* Removes the inline font sizing.
*
* @param string $tags holds markup of tags
*
* @return string
*/
function set_tag_cloud_sizes( string $tags ): string {
return preg_replace( '/style="font-size: \d+pt;"/', '', $tags );
@saltnpixels
saltnpixels / aspect-ratio
Created June 17, 2021 14:05
aspect-ratio images
.aspect-ratio {
position: relative;
// needs a set height, so override when using on a component
&::before {
content: "";
display: block;
height: 0;
width: 100%;
}
@saltnpixels
saltnpixels / base.css
Last active January 11, 2022 02:12
CSS Base
html {
font-size: 62.5%;
box-sizing: border-box;
}
* {
box-sizing: inherit;
}
body {