❌

Normal view

Resources for block theme development

With WordPress 5.8 launching on July 20th, it seems like a great time to round up some resources to help theme authors prepare for the future. By now, you’ve probably heard about block themes and the upcoming future of full site editing. Perhaps you have even begun to explore creating a block theme or adapting your current theme to some of the new features, like template editing mode. Whether you’re just starting out or already deep in the block theme world, the following resources should help you be aware of what’s to come and how to get involved in shaping the future. If you’re looking for a quick snapshot, it’s recommended to review the following for 5.8: 

Curate your information

Since block themes are currently evolving along with the features to support them, it’s helpful to start by figuring out what will help you stay up to date with the latest happenings, as that makes sense for you. Here are a few options:

Dive into resources

Outside of knowing the latest, it helps to know what the best practices are to follow. The following should give you great places to start: 

Learn from and with others

Since this is an area that folks across the WordPress community are diving into, there are some fantastic ways to keep in touch with what others are experimenting with, how they are solving problems, how they are getting started, and more. Especially during a time where we can’t meet up and look over someone’s shoulder at a WordCamp, hopefully these resources help bridge that divide even a tiny bit. 


While these are the resources we found most useful, we’d love to hear from you too. What resources have been helpful for you to explore block themes and the various pathways leading up to full site editing? Share in the comments so we can all learn together. 

Universal Themes: Customization

In the last post we shared the idea of a “universal” theme. This post looks at how we can use classic WordPress tools (in this case the Customizer) to customize a block theme, while saving these changes in Global Styles – making a universal theme!

Global Styles Everywhere

Block themes use a theme.json file to define many aspects of the theme, e.g. color palettes and typography. Gutenberg provides a tool to edit these settings (called Global Styles). When a user changes these values in the Global Styles UI, the changes are not saved back into the theme.json file but instead are saved to a Custom Post Type (CPT) in WordPress. Because this CPT can be modified using WordPress APIs, this gives us the power to make changes to Global Styles without relying on the interface in Gutenberg.

This simple idea is the basis for the color and typography customization options we have added to our universal theme Blockbase. The rest is just implementation details…

Implementation details!

When the Customizer loads, we create two new sections:

  1. Colors
  2. Fonts
$wp_customize->add_section(
	'customize-global-styles-colors',
	array(
		'capability'  => 'edit_theme_options',
		'description' => sprintf( __( 'Color Customization for %1$s', 'blockbase' ), $theme->name ),
		'title'       => __( 'Colors', 'blockbase' ),
	)
);
$wp_customize->add_section(
	'customize-global-styles-fonts',
	array(
		'capability'  => 'edit_theme_options',
		'description' => sprintf( __( 'Font Customization for %1$s', 'blockbase' ), $theme->name ),
		'title'       => __( 'Fonts', 'blockbase' ),
	)
);

In each of these sections we create new settings and controls – each setting and control relates to a color/font option in Global Styles. We read the content of the theme.json file and use this to populate the settings in the Customizer. There is a helpful function in Gutenberg which merges together the theme.json settings with any user settings:

WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_raw_data();

We read in an array of color palettes from the theme.json file and display these inside the “Colors” section:

Previews

One of the powers of Global Styles is that it relies on CSS variables. This makes it very easy for us to update the Customizer preview when the controls are changed. Some simple javascript injects new values for these CSS variables into the page, meaning that the preview updates instantly.

First we bind a listener to the control:

// For each of the palette items add a listener
userColorPalette.forEach( ( paletteItem ) => {
	const settingName = userColorSectionKey + paletteItem.slug;
	wp.customize( settingName, ( value ) => {
		value.bind( ( newValue ) => {
			paletteItem.color = newValue;
			blockBaseUpdateColorsPreview( userColorPalette );
		} );
	} );
} );

This updates the global variable userColorPalette, which we then use to create our CSS variables:

function blockBaseUpdateColorsPreview( palette ) {
	// build the CSS variables to inject
	let innerHTML = ':root,body{';
	palette.forEach( ( paletteItem ) => {
		innerHTML += `--wp--preset--color--${ paletteItem.slug }:${ paletteItem.color };`;
	} );
	innerHTML += ';}';

	// inject them into the body
	const styleElement = document.getElementById(
		'global-styles-colors-customizations-inline-css'
	);
	styleElement.innerHTML = innerHTML;
}

Saving

Customizer settings are usually saved in a site option or a theme mod. Since we are building a universal theme, we need to save these changes into Global Styles so that they are reflected in the Site Editor. The easiest way we found to achieve this was to hook into the customize_save_after action, read the settings from the controls, and then update the Global Styles CPT with the new settings. This code is used to get and read the CPT:

WP_Theme_JSON_Resolver_Gutenberg::get_user_custom_post_type_id();
get_post( $user_custom_post_type_id );
json_decode( $user_theme_json_post->post_content );

Once you have the CPT in JSON form it’s simply a case of adding the new settings to it, and saving them back into the CPT:

$user_theme_json_post_content->settings->color->palette = $this->user_color_palette;

wp_update_post( json_encode( $user_theme_json_post_content ) );

Color Palettes

Color palettes are simply combination of color settings. When a user selects a palette we simply change all of the associated colors at once. This can be done with the Javascript API:

wp.customize.control( userColorSectionKey ).setting.set( color );

How can I use this?

The code above is just pseudo code, to explain the concepts. For a fully working example see Blockbase freely available in our free themes repository. This code has a GPL license and can therefore be copied and distributed freely.

However, if you are interested in building a universal theme I would encourage you to use Blockbase as a parent theme. This will mean you get all future improvements to your theme for free!

Ephitah

The Customizer gets a bad rap, and it’s true that it is clunky when compared to the direct manipulation that is possible with Gutenberg. Nevertheless, building these kinds of tools to update Global Styles without the framework of the Customizer would have been much more involved. There is some satisfaction in being able to take advantage of all the hard work that has gone into the Customizer in its final years!

Changelog #47 – Developing Block Plugins, Gutenberg 11 and Upcoming WordPress 5.8

Birgit Pauli-Haack and Grzegorz Ziolkowski discuss Developing Block Plugins, Gutenberg 11 and Upcoming WordPress 5.8. Music: Homer Gaines Editor: Sandy Reed Logo: Mark Uraine Production: Pauli Systems Show Notes / Transcript Subscribe to the Gutenberg Changelog podcast via your favorite podcast apps!🎙️ Spotify | Google | iTunes | PocketCasts | Stitcher |🎙️ Pod Bean | CastBox | Podchaser | RSS Feed  Show Notes Building Blocks Plugins A Primer on Gutenberg Block Plugins for the WordPress Block Directory by […]

💾

How Cool Is An Extra Fan on Your GPU?

💾

There are a few things I probably should have talked about in this video but I wanted to keep it short. A couple examples may be the effect on the extra cooling to cause the stock fans to run slower than they normally would and the relatively slow fan that I used. Short answers to both of those are ease of use and practicality.

Support us on Patreon :)
https://www.patreon.com/techilliterate

Or you can hit the easy buttons, just LIKE and SUBSCRIBE. It really helps a lot!

0:00 PTSD
0:18 My 3080 ti fan theory
1:09 Test parameters
2:12 Pull fan configuration
2:55 Test results
4:55 Final thoughts
5:26 Bloops

Music - Drop Off by Chris Doerksen, Through The Atmosphere by Chris Doerksen
https://soundcloud.com/chris-doerksen-1

How Cool Is An Extra Fan on Your GPU?


Tags: graphics card, rtx 3080 ti, 3080 ti fe, 3080 extra cooler, 3080 tie, graphics card stock, pc gaming, graphics card for pc, 3080 founders edition, 3080 ti founders edition, hot 3080, hot 3080 ti, high temps 3080, high temps 3080 ti, 3080 too hot, 3080 ti too hot, adding fan to gpu, new gpu fan, extra gpu fan, case fan on gpu, chassis fan on gpu, tech illiterate

Podcast Revoar: Vigilância em tempos de pandemia

💾

A chegada da pandemia de Covid-19 fez com que governos tivessem que se mobilizar rapidamente para conter um vírus até então desconhecido. Como as tecnologias de vigilância foram utilizadas durante a crise sanitária? Nathalie Fragoso e João Abreu exploram o tema.

O podcast Revoar é uma produção da Rádio Novelo para o LAUT, o Centro de Análise da Liberdade e do Autoritarismo. A terceira temporada é apresentada por Anna Carolina Venturini e Felipe de Paula.

Novos episódios às quintas.

Para ouvir os demais episódios, acesse a playlist https://bit.ly/revoarpodcast ou visite o site do programa https://bit.ly/revoart3ep2

Ficha técnica
O podcast é uma produção da Rádio Novelo para o LAUT
Apresentação: Anna Venturini e Felipe de Paula
Coordenação geral: Clara Rellstab
Roteiro: Anna Venturini, Felipe de Paula, Luisa Plastino e Pedro Ansel
Tratamento de roteiro: Clara Rellstab
Pesquisa: Pedro Ansel e Luisa Plastino
Edição e montagem: Claudia Holanda e Julia Matos
Finalização e mixagem: João Jabace
Engenheiro de som: Gabriel Nascimbeni (Estúdio Trampolim)
Música original: Mari Romano
Identidade visual: Sergio Berkenbrock dos Santos
Coordenação digital: Iara Crepaldi e Bia Ribeiro
Redes sociais: Andressa Maciel

Proust's Way

This week, Thea Lenarduzzi and Lucy Dallas are joined by Adam Watt, Professor of French and Comparative Literature at the University of Exeter, to mark 150 years since the birth of Marcel Proust, whose legacy seems stronger than ever; Sarah Lonsdale, the author of 'Rebel Women Between the Wars', re-considers ‘Diary of a Provincial Lady’, a funny novel about interwar life in deepest Devon whose darker tones tend to be overlooked; plus, Mary Beard on new developments at the Colosseum.


A special subscription offer for TLS podcast listeners: www.the-tls.co.uk/buy/pod


Producer: Ben Mitchell


Hosted on Acast. See acast.com/privacy for more information.

💾

Conheça O Código do Russo

'O Código do Russo' narra a ascensão e a queda de Sergio Moro. De juiz intocável a ministro rejeitado. De bacharel interiorano a protagonista da mais importante batalha jurídica e política do Brasil em décadas. Entenda, em seis episódios, como o código penal particular do 'Russo' alterou o curso de três eleições presidenciais e mudou para sempre a história da Justiça brasileira. Uma produção Half Deaf.

💾

Episode 12: WordPress – In Person!

In this episode, Josepha Haden Chomphosy talks about WordPress – In Person! The WordPress events that provide the dark matter of connection that helps sustain the open source project. Have a question you’d like answered? You can submit them to wpbriefing@wordpress.org, either written or as a voice recording. Credits Editor: Dustin Hartzler Logo: Beatriz Fialho […]

💾

20 | Da Tortura à Loucura - com Amanda Rossi

No dia 14 de junho, a jornalista Amanda Rossi publicou uma reportagem no UOL que revela mais um capítulo então desconhecido da nossa história: a internação de presos políticos em manicômios na época da ditadura militar. Em meio a todo caos diário, é importante não perdermos de vista o passado que nos conta muito de como chegamos até aqui, além de nos mostrar um panorama de onde poderemos chegar. Por isso, convidamos a Amanda para contar essa história de apuração estarrecedora em detalhes. Na conversa com Andrea Dip e Thiago Domenici, Amanda fala sobre os bastidores dessa apuração, os personagens, os relatos e o que isso tem a dizer sobre o nosso presente.

Quando você apoia a Pública, sua contribuição se transforma em jornalismo investigativo sério e corajoso, com impactos reais. R$ 10 por mês já fazem uma grande diferença. Nos ajude a revelar as injustiças, abusos de poder e violações de direitos que se agravam em meio à pandemia. Seja nosso Aliado!

E MAIS:

||Natália Viana com o Personagem da Semana


|| No A Boa do Povo: dicas culturais cheias de boas leituras para esses dias frios.

> Dip indica o livro "Por que voltava todo verão?" da editora elefante, um relato forte em primeira pessoa sobre a história de um abuso e seus desdobramentos: https://elefanteeditora.com.br/produto/por-que-voce-voltava-todo-verao/
> Thiago indica o blog Todas as Letras (que acabou essa semana) do nosso parceiro de Rádio Guarda-Chuva, o jornalista Renan Sukevicius do podcast Finitude. No blog, ele trata de temas como diversidade afetiva, sexual e de gênero. O último texto é imperdível. https://todasasletras.blogfolha.uol.com.br
> Amanda indica o livro Geografia da Pele, de Evaristo de Miranda, que conta de forma brilhante a sua passagem pelo continente africano nos anos 70. Mais do que recomendado para quem se interessa por literatura africana ou sobre a região.

=======


CARTINHA PÚBLICA

Não faça como o Sr. Wizard na CPI, conte tudo pra nós no e-mail podcasts@apublica.org , dúvidas, sugestões, elogios, manda lá que nós vamos ler no próximo programa.


======
E não esqueça de seguir o Pauta Pública no seu tocador favorito.


====
PARCERIA RÁDIO GUARDA CHUVA

E num episódio em que falamos sobre a importância da visibilidade sobre assuntos que fazem parte da realidade do país, vamos indicar o episódio 50 - Gente invisível não estraga parede do podcast Rádio Escafandro, nosso parceiro na Rede Guarda Chuva.

Apresentado por Tomás Chiaverini é um episódio em dois atos.
No primeiro ato, um mergulho em histórias de pessoas que desaparecem nas grandes metrópoles. São muitas. Só em São Paulo, a polícia registra, em média, 20 casos de pessoas desaparecidas todos os dias. Felizmente, muitas acabam reencontradas.
E isso se deve, em boa medida, ao trabalho de um homem: Darko Hunter, responsável pela Divisão de Localização Familiar e Desaparecidos da Secretaria Municipal de Direitos Humanos e Cidadania.



==

A abertura do programa foi feita com a locução e edição de Ricardo Terto, lendo ofícios de internação psiquiátrica que foram linkados na reportagem a Amanda no UOL. Você pode acessá-los aqui.

======


Apresentação: Andrea Dip e Thiago Domenici ||
Produção: Ricardo Terto ||
Pauta e Roteiro: Andrea Dip, Ricardo Terto e Thiago Domenici ||
Roteiro e Locução Personagem da Semana: Natalia Viana ||
Edição e Mixagem Final: Ricardo Terto ||
Artes: Wagner Toneli ||
Redes: Ravi Spreizner e Tainah Ramos ||
Trilha original composta por Pedro Vituri

Saiba que você pode ser aliado da Agência Pública e colaborar com esse trabalho. Saiba mais em apoie.apublica.org ou faça um pix de qualquer valor para contato@apublica.org.
Contamos com seu apoio!

💾

#44 - Fala, Ney!

Por ocasião do lançamento de biografia escrita por Júlio Maria, Ney Matogrosso repassa fatos importantes em seus 80 anos de vida e 50 de carreira. Neste episódio especial de aniversário, o 451 MHz também traz um quadro novo com indicações do melhor da literatura LGBTI+.

Seja um Ouvinte Entusiasta e apoie o podcast 451 MHz: https://bit.ly/Assine451

💾

ErgoChair Core (MyoChair Recline) Honest Review | Worth Your Money?

💾

If after watching this video you are interesting in buying from Autonomous then you can help me out and take a discount: https://www.autonomous.ai?rid=426a8a

Support us on Patreon :)
https://www.patreon.com/techilliterate

Or you can hit the easy buttons, just LIKE and SUBSCRIBE. It really helps a lot!

0:00 Intro
0:32 Shipping time, assembly
1:13 ErgoChair Core Giveaway
2:03 My Height and Weight, limit
2:30 Casters, base
2:53 Height adjustment
3:22 Back tilt
4:09 Seat cushion
5:05 Armrests
5:33 Chair back
6:01 Lumbar support
7:13 Back not upright enough
8:26 Head rest
9:20 Leg rest
10:57 Concerns
12:00 Seat/back wobble
12:26 Build quality and warranty
13:25 Still deleting reviews?
14:26 Conclusion
14:44 Bloops

Music - Back To The Future Jellyfish by NoMBe

ErgoChair Core (MyoChair) Honest Review | Worth Your Money?

ErgoChair Recline

Podcast Revoar: Cuidado, estão te vigiando

💾

Coleta de dados por sites de buscas, grupos que fazem justiça com as próprias mãos, perfis em redes sociais. Como esses fenômenos se relacionam com vigilância e vigilantismo? Qual é a diferença entre esses dois conceitos? Na estreia da terceira temporada, Yasodara Córdova e Sérgio Amadeu nos ajudam a responder essas perguntas.

O podcast Revoar é uma produção da Rádio Novelo para o LAUT, o Centro de Análise da Liberdade e do Autoritarismo. A terceira temporada é apresentada por Anna Carolina Venturini e Felipe de Paula. Novos episódios às quintas. Para ouvir os demais episódios, acesse a playlist https://bit.ly/revoarpodcast ou visite o site do programa https://bit.ly/revoart3ep1

Ficha técnica
O podcast é uma produção da Rádio Novelo para o LAUT
Apresentação: Anna Venturini e Felipe de Paula
Coordenação geral: Clara Rellstab
Roteiro: Anna Venturini, Felipe de Paula, Luisa Plastino e Pedro Ansel
Tratamento de roteiro: Clara Rellstab
Pesquisa: Pedro Ansel e Luisa Plastino
Edição e montagem: Claudia Holanda e Julia Matos
Finalização e mixagem: João Jabace
Engenheiro de som: Gabriel Nascimbeni (Estúdio Trampolim)
Música original: Mari Romano
Identidade visual: Sergio Berkenbrock dos Santos
Coordenação digital: Iara Crepaldi e Bia Ribeiro
Redes sociais: Andressa Maciel

Strange Worlds of Their Own


This week, Thea Lenarduzzi and Lucy Dallas are joined by the novelist Margaret Drabble to consider the ‘curiously free-floating reputation’ of Russell Hoban, whose adult novels, including ‘Riddley Walker’, now appear as Penguin Modern Classics; as twin exhibitions mark the centenary of the birth of the English sculptor, painter, writer, designer and illustrator Michael Ayrton, the critic Boyd Tonkin delves into the myth-laden maze of the artist’s thought


‘From Oprah to Medusa: The endlessly various world of Russell Hoban’ by Margaret Drabble: www.the-tls.co.uk

‘Michael Ayrton: A singular obsession’, Fry Art Gallery Too, Saffron Walden, until October 31st

‘Michael Ayrton Centenary: Ideas, images, reflections’, edited by Justine Hopkins

‘Celebrating Michael Ayrton: A centenary exhibition’, the Lightbox, Woking, until August 8th


A special subscription offer for TLS podcast listeners: www.the-tls.co.uk/buy/pod


Producer: Ben Mitchell


Hosted on Acast. See acast.com/privacy for more information.

💾

Changelog #46 – Theme.json, DevNotes for WordPress 5.8, Gutenberg 10.9 and Upcoming BuddyPress Release 9.0

Birgit Pauli-Haack and Grzegorz Ziolkowski discuss Theme.json, Dev Notes for WordPress.5.8, Gutenberg 10.9 and Upcoming BuddyPress Release 9.0 Music: Homer Gaines Editor: Sandy Reed Logo: Mark Uraine Production: Pauli Systems Show Notes / Transcript Subscribe to the Gutenberg Changelog podcast via your favorite podcast apps!🎙️ Spotify | Google | iTunes | PocketCasts | Stitcher |🎙️ Pod Bean | CastBox | Podchaser | RSS Feed  Show Notes Full Site Editing & Theme.json FSE Program Polished Portfolios Summary FSE Program […]

💾

Thermal Paste Spread Under Glass

💾

Today I want to look at what different thermal paste application methods look like under glass. Well, not glass but some acrylic. Same thing right?

US Links
TM30 paste: https://amzn.to/3nHr2vR
Noctua Thermal Compound: https://amzn.to/3QJdrDF

Canadian Links
TM30 paste: https://amzn.to/3XhC8cO
Noctua Thermal Paste: https://amzn.to/3CRGcrY

Support us on Patreon :)
https://www.patreon.com/techilliterate

Or you can hit the easy buttons, just LIKE and SUBSCRIBE. It really helps a lot!

0:00 Intro
0:33 Test procedure
0:50 The Pea Method
1:22 Rice grain
1:39 The Line
2:13 The 'X'
2:25 The Penta Dot
2:36 The Buttered Toast
3:25 The Tiny Dot
3:41 A Smiley Face
3:59 A Percent Sign
4:20 Spiral
4:48 Infinity Symbol
5:04 Square (Sqwerak)
5:18 Buttered Toast with Jam
6:00 Conclusion
6:37 Bloops

Music - plucked by Chris Doerksen
https://soundcloud.com/chris-doerksen-1


Thermal Paste Spread Under Glass

Theme patterns for the Site Editor

We’ve been bundling block patterns with all of our themes for quite a while now, but recent improvements to the Template Part and Query Loop blocks has opened up a whole new world for how patterns can be used.

Both blocks can now display a carousel of block patterns in their setup state, allowing users to choose between a menu of pre-designed versions of these blocks. These patterns can be bundled with your theme, so that users have a wide range of pre-designed header, query, and footer options available to choose from in the Site Editor:

The only difference between these and other patterns you’d build is that they include a special blockTypes property to let Gutenberg know which block to associate them with. Here’s a simplified example:

register_block_pattern(
	'theme/pattern-slug',
	array(
		'title'       => _x( 'Pattern Title' 'theme-slug' ),
		'blockTypes'  => array( 'core/template-part/header' ),
		'content'     => '<!-- Your Pattern Markup -->'
	)
);

The markup above specifies that this pattern should be surfaced for a Header template part block. The value there would core/template-part/footer or core/query if you were designing a pattern for those blocks instead. (This property also powers pattern transforms, but that’s a topic for another time).

Once you register a pattern that way, it will show up in the carousel for the specified block. It’s as simple as that!

There are already a few Query Loop patterns bundled with Core today that use this method, and the header patterns shown in the video above are actually from a Gutenberg PR I’m working on as well. I’ve prepared a quick code example using our in-progress Quadrat theme to show how they could be bundled — we definitely plan on including a handful of these sorts of patterns in our block themes moving forward.

https://github.com/Automattic/themes/pull/4104

When combined together, Header, Query Loop, and Footer patterns allow you to mix-and-match pre-designed sections to create your entire website. I’m truly excited to see not only how themes use this feature, but how the Pattern Directory might provide hundreds more options for these blocks. This feels groundbreaking for WordPress, and I can’t wait to see how it turns out.

Podcast Revoar: Vigilância, vigilantismo e democracia

💾

Cuidado, estão te vigiando. Na terceira temporada do Revoar, Anna Carolina Venturini e Felipe de Paula conduzem oito episódios na companhia de especialistas que explicam como a vigilância e o vigilantismo estão presentes no dia a dia das democracias, quais são seus riscos e possíveis soluções contra arbitrariedades.

O podcast Revoar é uma produção da Rádio Novelo para o LAUT, o Centro de Análise da Liberdade e do Autoritarismo. A terceira temporada é apresentada por Anna Carolina Venturini e Felipe de Paula. Novos episódios às quintas. Para ouvir os demais episódios, acesse a playlist https://bit.ly/revoarpodcast ou visite o site do programa https://bit.ly/revoart3teaser

--

Ficha técnica
O podcast é uma produção da Rádio Novelo para o LAUT
Apresentação: Anna Carolina Venturini e Felipe de Paula
Coordenação: Clara Rellstab
Roteiro: Anna Venturini, Felipe de Paula, Luisa Plastino e Pedro Ansel
Tratamento de roteiro: Clara Rellstab
Pesquisa: Pedro Ansel e Luisa Plastino
Edição e montagem: Claudia Holanda e Julia Matos
Finalização e mixagem: João Jabace
Engenheiro de som: Gabriel Nascimbeni (Estúdio Trampolim)
Música original: Mari Romano
Identidade visual: Sergio Berkenbrock dos Santos
Coordenação digital: Iara Crepaldi e Bia Ribeiro
Redes sociais: Andressa Maciel
Para falar com a equipe: revoar@laut.org.br
--

Siga o Instagram do Revoar: @revoar.podcast
❌