Skip to content

Instantly share code, notes, and snippets.

View robspangler's full-sized avatar

Rob Spangler robspangler

View GitHub Profile
/* Define Variables */
:root {
--base-text-color: #111;
--primary-color: #00f;
--secondary-color: #0f0;
--base-bg-color: #eee;
}
/* Usage */
.sample {
@robspangler
robspangler / smooth-scroll.css
Created January 10, 2024 00:22
Pure CSS smooth scrolling with an optional offset (for fixed headers, for example)
html {
scroll-behavior: smooth;
}
#section-id {
scroll-margin-top: 100px;
}
/* All */
h2.custom-class { font-size: 62px; }
/* Tablet & Below */
@media (max-width:992px) {
h2.custom-class { font-size: 52px; }
}
/* Mobile */
@media (max-width:767px) {
if ( $activity != 'skate' ) {
die();
}
@robspangler
robspangler / select-field-custom-arrow.css
Last active January 11, 2023 18:57
Custom down chevron arrow for <select> form tags
select {
background: #fff url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIHdpZHRoPScyNCcgaGVpZ2h0PScyNCcgdmlld0JveD0nMCAwIDI0IDI0Jz48cGF0aCBmaWxsPScjNDQ0JyBkPSdNNy40MDYgNy44MjhsNC41OTQgNC41OTQgNC41OTQtNC41OTQgMS40MDYgMS40MDYtNiA2LTYtNnonPjwvcGF0aD48L3N2Zz4=") no-repeat 98% center !important;
}
Twitter
https://twitter.com/intent/tweet?url=URL&text=TITLE
Facebook
https://www.facebook.com/sharer/sharer.php?u=URL
Pinterest
https://pinterest.com/pin/create/button/?url=URL&media=IMG&description=TITLE
LinkedIn
@robspangler
robspangler / .htaccess
Last active July 7, 2022 19:17
Local to Live WordPress Upload Redirect
#DEV REWRITE
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+\.)(gif|jpe?g|png|webp)$ https://www.livedomain.com/$1$2 [R,L]
UPDATE wp_options SET option_value = replace(option_value, 'OLDURL', 'NEWURL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'OLDURL','NEWURL');
UPDATE wp_posts SET post_content = replace(post_content, 'OLDURL', 'NEWURL');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'OLDURL','NEWURL');
@media (max-width: 767px) {
.table-swipe { position: relative; }
.table-swipe table { max-width: calc(100% - 12px) !important; }
.table-swipe .wrap { width: 100%; overflow-y: scroll; -webkit-overflow-scrolling: touch; }
.table-swipe::before { display: block; z-index: 1; content: ''; position: absolute; right: 0; width: 12px; height: 100%;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,1+100 */
background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */
body {
-webkit-font-smoothing: antialiased;
}