A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
<html lang="ru"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script src="mozgoboj-map.js"></script> | |
<style> | |
#google-map { | |
height: 500px; |
Я также спросил это на GitHub. Предположим, есть компоненты Signin
и Signup
. Они близнецы:
Signup:
<main>
<h1 className={styles.h1}>Sign Up</h1>
<?php | |
/** | |
* MODX output filter | |
* Parse string from [[+placeholder]] and wrap every item with tpl. | |
* Parameters as JSON keys, tpl can be set as chunk name : | |
* [[+placeholder:stringParser=`{ "delimiter" : ", ", "tpl" : "my_chunk`]] | |
* or with @INLINE: | |
* [[+placeholder:stringParser=`{ "delimiter" : ", ", "tpl" : "@INLINE [[+item]]" }`]] | |
* Requrements: pdoTools. | |
*/ |
[[pdoMenu:striptags:htmlentities:strip? | |
&lastClass=`last` | |
&firstClass=`` | |
&hereClass=`` | |
&parentClass=`` | |
&rowClass=`` | |
&outerClass=`` | |
&innerClass=`` | |
&levelClass=`` | |
&selfClass=`` |
<?php | |
if ( $modx->event->name == 'OnDocFormSave' && $mode == modSystemEvent::MODE_NEW ) { | |
switch ( $resource->get( 'template' ) ) { | |
case 1: | |
$properties = $modx->fromJSON( $resource->get( 'properties' ) ); | |
$properties[ 'ms2gallery' ] = array( 'media_source' => 2 ); | |
break; | |
default: | |
break; |
<?php | |
if ( $modx->event->name == 'OnDocFormRender' && $mode == modSystemEvent::MODE_NEW ) { | |
$template = $modx->runSnippet( 'pdoField', array( | |
"id" => $_REQUEST['parent'] | |
, "field" => "template" | |
, "top" => 0 | |
) ); | |
switch ( $template ) { | |
case 1: | |
$template = 2; |
data_directory: ../_data/ | |
backup_directory: ../_backup/ | |
data: | |
contexts: | |
class: modContext | |
primary: key | |
context_settings: | |
class: modContextSetting | |
primary: | |
- context_key |
/** | |
* By Zell Liew | |
* from http://zellwk.com/blog/web-typography-broken/ | |
*/ | |
.vertical-rhytm__checker { | |
background-image: repeating-linear-gradient(to bottom, transparent 0px, transparent 23px, red 23px, red 24px); | |
background-position: 0 -6px; /* Moves baseline grid */ | |
} |
pre { outline: 1px solid #ccc; padding: 5px; margin: 5px; } | |
.string { color: green; } | |
.number { color: darkorange; } | |
.boolean { color: blue; } | |
.null { color: magenta; } | |
.key { color: red; } |