henrikhb / wp-block-description-list

A wordpress gutenberg block plugin for description lists.
17 stars 3 forks source link

Additional CSS class not applied #13

Open strarsis opened 5 years ago

strarsis commented 5 years ago

@lassemt: I set an additional CSS class for the description list block in Gutenberg editor, but it doesn't appear in markup at all.

Gutenberg 5.5.0.

hacknug commented 5 years ago

I've just tested on a Local site and it's working fine for me. Are you using the "Additional CSS Class" input under "Advanced"?

strarsis commented 5 years ago

@hacknug: Yes, because there is another bug (in Gutenberg core) that prevents using the Styles tab (crash when opening the Styles tab).

hacknug commented 5 years ago

What do you mean by "Styles tab"? Also, what version of WordPress and Gutenberg (if using the plugin) are you on?

strarsis commented 5 years ago

@hacknug: Clarification: The class is set on the frontend, but not on the backend (Gutenberg editor page), but this is expected behaviour, too, for being able to style the Gutenberg block.

WordPress: 5.1.1 Gutenberg: 5.5.0

hacknug commented 5 years ago

@strarsis I've fixed it on my fork. Can you please test if it solves your issue? https://github.com/hacknug/wp-block-description-list

@lassemt I've noticed we're using <div> for both <dt> and <dd> on our edit method. Do you think it'd be a good idea to also render the right elements in case anyone else expects both save and editto be more similar? Any reason to not do this at all? I'll open a PR fixing it if it's okay with you.

strarsis commented 5 years ago

@hacknug: I just installed the plugin from your repo instead, but the class is still not applied on the backend. I can see the changes you made in the last commit so indeed your repo is used now.

hacknug commented 5 years ago

Are you adding classes to the list itself or to the list items? The list should be working now (at least it was when I tested on development mode) as any blocks you add inside the list items (doesn’t matter if a term or definition) because of core.

If it is the list itself that it’s not working properly for you, try cloning my fork inside your plugins folder and running npm run start to see if it might be something related with the build files themselves.

Either way I’ll take another look to it tomorrow and get back to you.

strarsis commented 4 years ago

@hacknug: Follow up: The style selection is finally working in Gutenberg editor, and when I select a different style for the description list than default, the corresponding CSS class is not applied (e.g. is-style-services) in backend (but in frontend), hence no correct preview is formatted in Gutenberg editor.

strarsis commented 4 years ago

@hacknug: I guess in the code for the editor part the code for adding properties/classes is simply missing in contrast to other blocks. Any plans to fix this in the near future?

hacknug commented 4 years ago

@strarsis I'm taking a break and won't do any more open-source work until things get better in Barcelona or I really feel like it. Police are doing all kinds of crazy stuff and it seems it's not stoping any time soon.

Won't fix the issues with this plugin for the following reasons:

Sorry if you were hoping to get this sorted out. I actually took a look at it last week before the incidents here scaled up and the only solution I liked that would solve some of the issues would be rewriting the whole thing using wp-scripts.

I'd recommend using @kellymears's fork of this plugin. Works fine and you only need to use wp_dequeue_style( 'tinyblocks/glossary/css' ); to make things look okay in the admin.

🔥🌹

strarsis commented 4 years ago

@hacknug: Thanks for the summary. I will try out the fork. The <dl> blocks are very useful. Do you mean with "nested blocks" a specific, narrowed down feature in Gutenberg blocks or the whole concept of nesting blocks into other blocks?

kellymears commented 4 years ago

@hacknug long-time fan, first-time caller. i love your work!