Skip to content

Instantly share code, notes, and snippets.

View Aljullu's full-sized avatar

Albert Juhé Lluveras Aljullu

View GitHub Profile
@Aljullu
Aljullu / all-woocommerce-patterns.txt
Last active June 9, 2023 09:42
All WooCommerce patterns
<!-- wp:heading {"anchor":"banner"} -->
<h2 class="wp-block-heading" id="banner">Banner</h2>
<!-- /wp:heading -->
<!-- wp:group {"align":"wide","style":{"color":{"background":"#f9eddb","text":"#443127"},"spacing":{"padding":{"right":"50px","bottom":"50px","left":"50px","top":"50px"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignwide has-text-color has-background" style="color:#443127;background-color:#f9eddb;padding-top:50px;padding-right:50px;padding-bottom:50px;padding-left:50px"><!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"style":{"spacing":{"padding":{"left":"110px"}}}} -->
<div class="wp-block-column" style="padding-left:110px"><!-- wp:group {"style":{"spacing":{"padding":{"top":"0","right":"0","left":"0"}}},"layout":{"type":"constrained","wideSize":"360px","justifyContent":"left"}} -->
<div class="wp-block-group" style="padding-top:0;padding-right:0;padding-left:0"><!-- wp:paragraph {"style":{"color":{"text":"#c85643"},"typography":{"fontSize":"18px"},"spacing
@Aljullu
Aljullu / all-woocommerce-blocks.htm
Last active February 17, 2024 16:58
WC Blocks (all blocks). Ready to be copied (Ctrl+C) and pasted (Ctrl+Shift+V) into the editor.
<!-- wp:woocommerce/featured-product {"editMode":false,"productId":15} -->
<!-- wp:button {"align":"center"} -->
<div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="https://ephemeral-aljullu-20200929.atomicsites.blog/product/beanie/">Shop now</a></div>
<!-- /wp:button -->
<!-- /wp:woocommerce/featured-product -->
<!-- wp:woocommerce/featured-category {"editMode":false,"categoryId":16} -->
<!-- wp:button {"align":"center"} -->
<div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="https://ephemeral-aljullu-20200929.atomicsites.blog/product-category/clothing/">Shop now</a></div>
<!-- /wp:button -->
@Aljullu
Aljullu / wc-blocks-styling.scss
Created June 22, 2020 17:47
WC Blocks example theme CSS
// Sets the colors of the Button component used in the Cart and Checkout blocks.
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/main/docs/theming/cart-and-checkout.md#button
.wc-block-components-button {
background-color: $heading-color;
color: $background-color;
}
// Sets the colors of the summary item quantity badge shown in the Cart sidebar.
// See https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/main/docs/theming/cart-and-checkout.md#item-quantity-badge
.wc-block-components-order-summary-item__quantity {
@Aljullu
Aljullu / prettier.diff
Created December 17, 2019 09:51
prettier.diff
diff --git a/assets/js/base/components/checkbox-list/index.js b/assets/js/base/components/checkbox-list/index.js
index d36b116..c540916 100644
--- a/assets/js/base/components/checkbox-list/index.js
+++ b/assets/js/base/components/checkbox-list/index.js
@@ -99,9 +99,9 @@ const CheckboxList = ( {
{ options.map( ( option, index ) => (
<Fragment key={ option.value }>
<li
- { ...shouldTruncateOptions &&
+ { ...( shouldTruncateOptions &&
@Aljullu
Aljullu / MyImage.jsx
Created March 22, 2018 18:46
MyImage.jsx (react-lazy-load-component example)
import React from 'react';
import { LazyLoadImage } from 'react-lazy-load-image-component';
const MyImage = ({ image }) => (
<div>
<LazyLoadImage
alt={image.alt}
height={image.height}
src={image.src}
width={image.width} />
@Aljullu
Aljullu / Article.jsx
Created March 22, 2018 18:46
Article.jsx (react-lazy-load-component example)
import React from 'react';
import { ArticleContent, ArticleComments } from 'my-app';
import { LazyLoadComponent } from 'react-lazy-load-image-component';
const Article = ({ articleId }) => (
<div>
<ArticleContent id={articleId} />
<LazyLoadComponent>
<ArticleComments id={articleId} />
</LazyLoadComponent>
@Aljullu
Aljullu / Gallery.jsx
Created March 22, 2018 18:45
Gallery.jsx (react-lazy-load-component example)