Skip to content

Instantly share code, notes, and snippets.

View cadoo's full-sized avatar
🤔

Cadoo cadoo

🤔
View GitHub Profile
@cadoo
cadoo / container.css
Created August 31, 2023 12:45
Modern, ultra-flexible container
.container {
width: min(100vw - 3rem, var(--container-max, 80ch) );
margin-inline: auto;
}
/* https://moderncss.dev/contextual-spacing-for-intrinsic-web-design/ */
@cadoo
cadoo / chatgpt-robots.txt
Created August 30, 2023 14:34
Disallowing GPTBot
User-agent: GPTBot
Disallow: /
@cadoo
cadoo / oklch.css
Created August 30, 2023 13:54
OKLCH colors with fallback
html {
--brandYellow: hsl(53.81 97% 58%);
background: var(--brandYellow);
}
@supports (color: oklch(0% 0 0)) {
html {
--brandYellow: oklch(91.91% 0.22 102.16);
}
}
@cadoo
cadoo / linkedin.hbs
Created November 8, 2017 22:20
linkedin share
<a class="inline-block hop5 px1" href="https://www.linkedin.com/shareArticle?mini=true&url={{url absolute="true"}}&title={{encode title}}" onclick="window.open(this.href, 'linkedin-share', 'width=520,height=570');return false;">
<img class="align-middle" src="{{asset 'images/linkedin.svg'}}" alt="LinkedIn icon">
<span class="hide">LinkedIn</span>
</a>
@cadoo
cadoo / wordpress-search-filter.php
Last active December 21, 2016 08:31
WordPress search results types filter
/**
* Filter search results types
*/
function filter_search_types( $query ) {
if ( $query->is_search ) {
$query->set( 'post_type', array( 'post', 'alarm', 'store' ) );
}
return $query;
}
add_filter( 'pre_get_posts', 'filter_search_types' );

Below is just about everything you'll need to style in the theme. Check the source code to see the many embedded elements within paragraphs.


Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
@cadoo
cadoo / custom-css.html
Created August 26, 2016 08:12
custom-css-paperleaf
<link rel="stylesheet" type="text/css" href="{{asset "css/dist/custom.css"}}" />
.hentry--masonry .entry-title,
.featured-post-title {
display: none;
}
<?php
// Load parent theme styles
function sb_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) );
}
add_action( 'wp_enqueue_scripts', 'sb_enqueue_styles', 100 );
/*--------------------------------------------------------------
## Captions
--------------------------------------------------------------*/
.wp-caption {
margin-bottom: 1.5em;
max-width: 100%;
}
.wp-caption img[class*="wp-image-"] {
display: block;