Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct theme.json for table default border #30

Closed
bobbingwide opened this issue May 14, 2021 · 0 comments
Closed

Correct theme.json for table default border #30

bobbingwide opened this issue May 14, 2021 · 0 comments
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented May 14, 2021

In 0750959 I added an attempt to style the table border
by adding a core/table element to styles

"core/button": {
        "border": {
          "radius": "5px"
        },
       "core/table": {
          "border": {
            "color": "green",
            "width": "2px",
            "style": "dashed"
          }
       }
      }
    }

It didn't work but I didn't know why not.
The theme.json file passed the JSON lint test, but it didn't produce the correct results.

The problem was not syntax but semantics. All the brackets are there, they’re just in the wrong order.
The structure was incorrect.

Instead of being the following elements:

  • blocks.core/button.border.radius
  • blocks.core/table.border.color and .width and .style

we get

  • blocks.core/button.border.radius
  • blocks.core/button.core/table.border.color and .width and .style

The fix is to move one of the close curly braces to after core/button.border.radius.

Without any tooling this is going to be one of the harder problems to debug.
I imagine there'll be many similar problems with people attempting to use the wrong CSS variable names
in both stylesheets such as style.css and in the styles element.

eg --wp--preset--color--link or --wp--preset--font-family--opensans

@bobbingwide bobbingwide self-assigned this May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant