Pattern CSS – The CSS Editor For Blocks
The missing inline block CSS editor for the Gutenberg editor. Very powerful with synced patterns as well. And it pairs well with global styles. This plugin is perfect for users looking to add CSS for blocks without needing to create a child theme, or use a bloated plugin. Client safe too. CSS won’t leak outside of the block, and only valid block CSS is persisted. Star it on GitHub Follow me on Twitter @kevinbatdorf How to Every block will have a new “Pattern CSS” settings panel Open it and add any CSS. It will be scoped to the block To target the block directly, you must use the [block] selector To target any element inside the block, use the normal CSS selector Use !important to override your theme styles (use sparingly) Global Editor Access global styles under the options menu (three dots) in the top right corner of the editor Additionaly, you can open from the Pattern CSS block editor controls Features Powered by WebAssembly for fast and secure CSS parsing Smart loading. Only loads the CSS when the block is present Styles persist when changing themes Scopes styles to the block so that parent/sibling blocks are not affected It’s fast CSS is minified and optimized It’s safe. Invalid, non-spec CSS is never persisted Supports reusable (synced or not-synced) patterns See changes on the page as you make them Combines adjacent rules (to decrease size) Minifies colors and math functions to simplify according to spec Supports CSS nesting Basic Example /* Target the block directly */ [block] { background: antiquewhite; padding: 2rem; } /* Target any inner elements */ a { text-decoration-color: burlywood; text-decoration-thickness: 2px; text-decoration-style: solid !important; } a:hover { text-decoration-color: darkgoldenrod; } /* Output: */ .pcss-a1b7b016{background:#faebd7;padding:2rem}.pcss-a1b7b016 a{text-decoration-color:#deb887;text-decoration-thickness:2px;text-decoration-style:solid!important}.pcss-a1b7b016 a:hover{text-decoration-color:#b8860b} Supports Media Queries @media (prefers-color-scheme: dark) { [block] { border-color: blue; } } /* Output: */ @media (prefers-color-scheme:dark){.pcss-cddaa023{border-color:#00f}} Combines Rules [block] { color: red; } .bar { color: red; } /* Output: */ .pcss-3aa0f0fc,.pcss-3aa0f0fc .bar{color:red} Fixes redundant properties [block] { padding-top: 5px; padding-left: 50px; padding-bottom: 15px; padding-right: 5px; } /* Output: */ .pcss-3aa0f0fc{padding:5px 5px 15px 50px} Supports CSS nesting [block] { padding: 1rem; a { color: red; } background: white; /* Including media queries */ @media (prefers-color-scheme: dark) { background: black; color:white; } } /* Output: */ .pcss-f526bb2d{background:#fff;padding:1rem;& a{color:red}@media (prefers-color-scheme:dark){&{color:#fff;background:#000}}} Check browser support for CSS nesting
Top keywords
- block17×4.35%
- css15×3.84%
- color7×1.79%
- background6×1.53%
- media6×1.53%
- color red5×1.28%
- editor5×1.28%
- output5×1.28%
- padding5×1.28%
- red5×1.28%
- styles5×1.28%
- 5px4×1.02%
WP Live CSS Editor
A CSS live Editor that allows you to preview realtime CSS changes and then save your changes. It saves dated backups of each save, so you can go back if it breaks, and you should erase backups once on a while. It’s a port from a Drupal module Live CSS http://drupal.org/project/live_css by guybedford http://drupal.org/user/746802 Now using ACE editor http://ace.ajax.org/ Tested on WordPress 3.6. But needs more testing ! =capabilities.php problem (not bug) SOLVED != Ok, now I did the correct thing and created an action to the wp_loaded hook to init the plugin, then, check whether the user can “erase themes” which is an Admin capability only, so the plugin only works if you are an admin. No need to modify the capabilities.php nor anything else. Some users have had problems in former 12.05 release with their site being inaccesible after installing the plugin. It all seemed to be part of the same problem with the capabilities.php file that is discussed here: https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-wp_get_current_user-4?replies=32 It works nice and perfect for me, but still needs testing !!! Hola mundo ! Este plugin está basado en el módulo de [Drupal Live CSS] (http://drupal.org/project/live_css) de [guybedford] (http://drupal.org/user/746802) Es un editor de CSS que te permite editar en directo todas las hojas de estilo CSS de tu web, ver los cambios y guardar sobre la marcha. Está pensada para usarla al diseñar la web, por lo que conviene desactivarlo o desinstalarlo una vez terminada. Cada vez que se guardan los cambios se genera una copia de seguridad fechada, para que puedas volver atrás si hace falta. Utiliza ACE como editor. Sólo los administradores pueden usar el plugin. Importante !!! Hacer copia de respaldo de los archivos CSS antes de probarlo ! Aunque el plugin genera automáticamente copias de seguridad fechadas en el mismo directorio en que estén los archivos modificados, siempre conviene tener una copia del estado general de la cosa antes de empezar a trastear. Si no funciona al guardar o hacer la copia de seguridad aparece un mensaje con las rutas del archivo que se intentaba modificar, la de la copia de seguridad y tal vez un mensaje de error. Lo más seguro es que el problema sea de permisos. Los CSS que quieras editar deberían tener permiso de escritura 755. Instalación La instalación es la típica de cualquier plugin de wordpress. Desempaquetar el zip en wp-content/plugins, y listo. No hay que tocar los temas ni hacer nada más que activarlo desde el panel de administración. No tiene opciones ni página propia en el panel de administración. Probado en WordPress 3.3.2, tienes que ser un administrador para poder usarlo. Utiliza ahora el hook wp_loaded que arregla el problema de la versión anterior que se discutía aquí: https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-wp_get_current_user-4?replies=32 Más información http://drupal.org/project/live_css Live CSS http://drupal.org/user/746802 guybedford http://drupal.org/user/78427 http://mozillalabs.com/skywriter/2011/01/18/mozilla-skywriter-has-been-merged-into-ace/ http://www.ajax.org/ http://ace.ajax.org/ https://codex.wordpress.org/AJAX_in_Plugins http://briancray.com/2009/08/19/wordpress-head-element/ http://www.devlounge.net/code/using-ajax-with-your-wordpress-plugin http://amiworks.co.in/talk/simplified-ajax-for-wordpress-plugin-developers-using-jquery/ http://drupal.org/project/cssedit Realtime CSS Editor http://drupal.org/user/78427 tjholowaychuk