Skip to content

Instantly share code, notes, and snippets.

View Oliviercreativ's full-sized avatar

Démontant Oliviercreativ

View GitHub Profile
@Oliviercreativ
Oliviercreativ / gist:38d2248f49f054c46e6a45021fb91b7c
Created July 25, 2022 14:06 — forked from adamrosloniec/gist:58467267db06603dca73ff222e4b2e50
Wordpress with ACF - add background color to category / categories
function add_blog_category_color(){
$categories = get_categories(array( 'hide_empty' => 0, ));
if ( ! empty( $categories ) ) {
echo '<style type="text/css">';
foreach( $categories as $category ) {
$category_taxonomy = $category->taxonomy;
$category_id = $category->term_id;
$category_slug = $category->slug;
$category_color = get_field('blog_category_color',$category_taxonomy . '_' . $category_id);
/* Convert the standard WooCommerce products list into a modern responsive grid. */
ul.products {
--grid-gap: 32px;
--auto-grid-min-size: 200px;
grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
grid-gap: var(--grid-gap);
display: grid;
}
ul.products:before{
content:unset!important;
@Oliviercreativ
Oliviercreativ / code.scss
Created September 6, 2022 13:09 — forked from rohanb10/code.scss
Staggered Delays for Animations in SCSS
/**
* @param $interval - The interval between each delay, defaults to 500ms
* @param $startTime - The start time of the animations, defaults to 0ms
* @param $numberOfDelays - The total number of delays to be generated, defaults to 10
*/
@mixin delays($interval: 500, $startTime: 0, $numberOfDelays: 10) {
@for $i from 0 through $numberOfDelays {
$ms : $startTime + ($i * $interval);
&.delay-#{$ms} {
animation-delay: #{$ms}ms;