Skip to content

Instantly share code, notes, and snippets.

@Merott
Merott / tailwind-colors-as-css-variables.md
Last active April 26, 2024 11:06
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@maxivak
maxivak / readme.md
Last active April 11, 2023 15:08
Restore repo from Gitlab bundle file

Gitlab exports repositories to tar archive which contains .bundle files.

We have repo.bundle file and we want to restore files from it.

  • create bare repo from bundle file
git clone --mirror myrepo.bundle my.git
@kiub
kiub / modify-response-wp-rest-api.php
Created August 6, 2015 20:10
Modifying responses in WP Rest Api. Add featured image thumbnail to the response for a custom post type (by default return ID).
// in function.php
// Modify Responses WP Rest Api
add_action( 'rest_api_init', 'featured_image_thumbnail_url' );
// Modifying Responses
function featured_image_thumbnail_url() {
// More info http://v2.wp-api.org/extending/modifying/
register_api_field(