Skip to content

Instantly share code, notes, and snippets.

View lukaskleinschmidt's full-sized avatar

Lukas Kleinschmidt lukaskleinschmidt

  • Aachen, Germany
  • 08:16 (UTC +02:00)
View GitHub Profile
@lukaskleinschmidt
lukaskleinschmidt / app.scss
Last active September 11, 2023 14:50
Utility class generator like tailwindcss but in pure Sass.
@use 'sass:map';
@use 'variants' as * with (
$breakpoints: (
'small': 640px,
'medium': 768px,
'large': 1024px,
'wide': 1280px,
)
);
@lukaskleinschmidt
lukaskleinschmidt / Readme.md
Last active May 9, 2019 11:59
Kirby 3 uuid

You would need to install https://github.com/ramsey/uuid to make it work. Depending on the use case it could also make sense to implement those as traits.

<?php

class ArticlePage extends UuidPage
{
  
}
@lukaskleinschmidt
lukaskleinschmidt / js-component.php
Last active October 9, 2017 07:16
Kirby JS Component
<?php
namespace LukasKleinschmidt\Component;
use HTML;
use STR;
use C;
/**
* Kirby Script Tag Component
@lukaskleinschmidt
lukaskleinschmidt / breakpoint.js
Last active June 28, 2017 14:16
javscript components
import Component from './component';
export default class Breakpoint extends Component {
init(mediaQueryString) {
const mql = window.matchMedia(mediaQueryString);
const listener = () => this.trigger(mql.matches ? 'match' : 'unmatch', [mql]);
mql.addListener(listener);
this.set('mql', mql);
import set from 'lodash/set';
import get from 'lodash/get';
import has from 'lodash/has';
export default class Component {
constructor() {
this._data = {};
this._observers = {};
this.init && this.init.apply(this, arguments);
}
@mixin grid-fractions($divisors, $breakpoint: null) {
@each $divisor in $divisors {
@for $dividend from 1 through $divisor - 1 {
@if $breakpoint {
&--#{$dividend}\/#{$divisor}\@#{$breakpoint} {
flex-basis: $dividend / $divisor * 100%;
max-width: $dividend / $divisor * 100%;
}
}
@lukaskleinschmidt
lukaskleinschmidt / barba.js
Last active May 23, 2023 08:54
Determine history direction in barba.js
import History from './history';
import Barba from 'barba.js';
const history = new History();
Barba.Pjax.goTo = function(url) {
history.goTo(url);
this.onStateChange();
};