Skip to content

Instantly share code, notes, and snippets.

View sarahmonster's full-sized avatar
🏚️
House falling down, brb

sarah ✈ semark sarahmonster

🏚️
House falling down, brb
View GitHub Profile
@sarahmonster
sarahmonster / add-span-to-count.php
Created August 22, 2016 13:22
Adds a span around post counts in category archives widget and general archives widgets. This allows for easy styling of the count—for instance, using leading dots. (The SCSS file adds leading dots.)
/**
* Filter the categories archive widget to add a span around post count
*/
function smittenkitchen_cat_count_span( $links ) {
$links = str_replace( '</a> (', '</a><span class="post-count">(', $links );
$links = str_replace( ')', ')</span>', $links );
return $links;
}
add_filter( 'wp_list_categories', 'smittenkitchen_cat_count_span' );
@sarahmonster
sarahmonster / icon
Created June 21, 2019 21:25
React icon
/**
* External dependencies
*/
import React from 'react';
/**
* Internal dependencies
*/
import './_style.scss';
@sarahmonster
sarahmonster / init.coffee
Created May 20, 2019 20:29 — forked from tofumatt/init.coffee
Sync Settings for Atom
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
[user]
name = sarah
email = sarah@triggersandsparks.com
[push]
default = matching
[pull]
rebase = true
[rerere]
enabled = true
[color]
@sarahmonster
sarahmonster / deploybot
Created January 17, 2017 20:24
Ignores for deploybot.
**/*.scss
**/*.md
**/*.txt
**/*.json
**/*.gitignore
**/gulpfile.js
LICENSE
@sarahmonster
sarahmonster / centre.css
Created January 17, 2017 18:44
Center an absolutely-positioned element, because I'm always forgetting.
thing {
left: 50%;
transform: translate(-50%, 0);
}
@sarahmonster
sarahmonster / _lists.scss
Created December 3, 2016 02:02
Typographically more-correct lists
ul, ol {
margin: 0 0 1.5em 0;
padding: 0;
}
ul {
list-style: disc;
}
ol {
@sarahmonster
sarahmonster / extras.php
Created November 25, 2016 00:02
Excerpt customisation
/*
* Let's customize our excerpt a bit, so it looks better
* First we decrease the default excerpt length, then
* we give it a proper hellip for the more text.
*/
function themeslug_custom_excerpt_length( $length ) {
return 27;
}
add_filter( 'excerpt_length', 'themeslug_custom_excerpt_length', 999 );
@sarahmonster
sarahmonster / _navigation-top.scss
Last active November 15, 2016 18:40
Add a priority-plus navigation pattern to WordPress themes. Make sure to remove the menu-toggle button and make the main nav ul display block by default!
/* Hide more link unless we need it. */
#more-menu {
display: none;
&.visible {
display: inline-block;
}
}
@sarahmonster
sarahmonster / _breakpoints.scss
Last active November 8, 2016 18:05
Boilerplate breakpoints mixins.
@mixin mobile {
@media (max-width: #{$size__tablet-width - 1px}) {
@content;
}
}
@mixin tablet {
@media (min-width: #{$size__tablet-width}) {
@content;
}