Very lightweight way to get query params on your Alpine.js page. Good for storing data in the URL
import Spruce from '@ryangjchandler/spruce'
Spruce.store('settings', {})
export default Spruce
<?php | |
/** | |
* This file is part of the TelegramBot package. | |
* | |
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
<section x-data="{showModal: false, html: ''}"> | |
<button | |
@click="html='loading...'; showLoading = true; showModal = !showModal; | |
fetch('{{ entry.url }}', { | |
method: 'GET', | |
headers: { | |
'X-Requested-With': 'XMLHttpRequest', | |
}, | |
}) |
// Installation: | |
// yarn add -D @codemod/cli @babel/plugin-syntax-jsx @babel/generator | |
import jsx from '@babel/plugin-syntax-jsx'; | |
import generate from '@babel/generator'; | |
const COLOR_MAP = { | |
'white': 'white', | |
'near-white': 'gray-100', | |
'light-gray': 'gray-200', |
{% macro emailLinks(text, class) %} | |
{# v1 #} | |
{% spaceless %} | |
{% set text = text|replace('/([a-zA-Z0-9_.+-]+)+@([a-zA-Z0-9-]+.[a-zA-Z]+)/', '<a ' ~ (class ? 'class="' ~ class ~ '" ') ~ 'href="mailto:'~ '\\1@\\2' ~'">'~ '\\1@\\2' ~'</a>') %} | |
{{text|raw}} | |
{% endspaceless %} | |
{% endmacro %} |
const mix = require('laravel-mix'); | |
const tailwindcss = require('tailwindcss'); | |
require('laravel-mix-purgecss'); | |
mix.setPublicPath('./web') | |
.postCss('src/css/main.css', 'css') | |
.options({ | |
postCss: [tailwindcss('tailwind.config.js'), require('autoprefixer')], | |
processCssUrls: false, | |
}) |
.calendar { | |
tbody td { | |
border: 1px solid #dedede; | |
} | |
&__day { | |
&--available { | |
} |
Let There Be Peace On CSS: https://medium.com/@didoo/let-there-be-peace-on-css-8b26829f1be0
CSS and Scalability: http://mrmrs.cc/writing/2016/03/24/scalable-css/
About HTML Semantics and Front End Architecture: http://nicolasgallagher.com/about-html-semantics-front-end-architecture/
CSS Utility Classes and "Separation of Concerns": https://adamwathan.me/css-utility-classes-and-separation-of-concerns/
<?php | |
use Craft; | |
use craft\base\Element; | |
use craft\elements\User; | |
use craft\events\ModelEvent; | |
use yii\base\Event; | |
<?php | |
namespace modules; | |
use Craft; | |
use craft\elements\Asset; | |
use yii\base\Event; | |
/** | |
* Custom module class. | |
* |