Skip to content

Instantly share code, notes, and snippets.

@obrenoco
obrenoco / html-tags-details-summary.html
Last active July 22, 2024 04:17
HTML + CSS | Native accordion + Open Animation
<!DOCTYPE html>
<html>
<head>
<style>
summary {
cursor: pointer;
list-style: none;
}
details[open] summary ~ * {
animation: toggle 0.1s ease-in-out;
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active September 20, 2024 07:10
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.

@amroamroamro
amroamroamro / README.md
Last active August 12, 2024 14:12
[Python] Fitting plane/surface to a set of data points

Python version of the MATLAB code in this Stack Overflow post: https://stackoverflow.com/a/18648210/97160

The example shows how to determine the best-fit plane/surface (1st or higher order polynomial) over a set of three-dimensional points.

Implemented in Python + NumPy + SciPy + matplotlib.

quadratic_surface