Coder Social home page Coder Social logo

mrwweb / wordpress-block-editor-theme-support-starter Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 2.0 41 KB

Starter CSS for Themes Supporting the WordPress Block Editor

License: GNU General Public License v3.0

CSS 100.00%
wordpress theme-support block-editor gutenberg wordpress-theme-development wordpress-boilerplate gutenberg-editor

wordpress-block-editor-theme-support-starter's Introduction

Starter CSS for the WordPress Block Editor

It's awfully hard to remember the markup, classes, and options for all the new blocks in WordPress. This project aims to document that information in an easy-to-grab starter stylesheet for WordPress themes.

Contributions are encouraged! Submit a simple pull request or open an issue (encouraged before larger PRs).

Note on CSS selectors

The selectors in this project are as much for documentation as they are for styling. That's why every class is qualified with an element. This is particularly useful in cases where a block may change markup depending on it's configuration.

Depending on your CSS authoring preferences and site environment, you are encouraged to adjust selectors in your project to keep specificity as low as possible.

Comment Styles

Follow the TwentyTwenty section comment styles for block group sections and PHPDoc-like comments for a single block section.

Roadmap

  • Keep updated with future versions for WordPress (Issues & PRs greatly appreciated!)
  • Add SCSS version of stylesheets, possibly with useful features like @each loop for color classes (Feedback issue re: SCSS)
  • Add supplemental stylesheets for popular 3rd-party blocks
  • (Maybe?) Include relevant PHP functions for theme support
  • (Maybe?) Support for package managers

Finding This Useful?

You'll probably love the MRW Simplified Editor plugin.

wordpress-block-editor-theme-support-starter's People

Contributors

kelliwise avatar mrwweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wordpress-block-editor-theme-support-starter's Issues

What is the best way to document classes, options, etc.?

Currently all information about optional classes, inline styles, alignments, etc. is included in a comment preceding the block's CSS selectors. Here's the most verbose example:

/*
 * Button
 *
 * Note: Buttons container added in WP5.4
 *
 * Alignments: alignleft, aligncenter, alignright
 * Default Style Variations: is-style-outline
 * Possible Inline Styles: border-radius
 * Color Support: Background, Text
 */

Some questions I would love feedback on:

  1. Is this the best possible way to do this?
  2. Is any information missing or unclear?
  3. What would be a better way?

Should we provide an SCSS version?

My current intention with the project is to provide useful copy-and-pasteable files for WordPress themes.

Since CSS is valid SCSS, these files can be dropped into an .scss file without any issue. So, are there any ways in which a SCSS version of these files could provide extra value?

The likely changes I can think of would be:

  • Use a single layer of nesting for unqualified element selectors like .wp-block-quote cite
  • Provide some conveniences such as looped output of color classes

Are these improvements worth the extra maintenance cost? Could the CSS version be output cleanly from the SCSS version for easier upkeep? I lean toward yes on both questions but would love some more feedback!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.