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

Issues with blocklab CSS injection #1380

Closed
Zyles opened this issue Jul 29, 2020 · 1 comment
Closed

Issues with blocklab CSS injection #1380

Zyles opened this issue Jul 29, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Zyles
Copy link

Zyles commented Jul 29, 2020

Describe the bug

Not sure if Oxygen is the culprit here but I believe it is.

Using the BlockLab plugin which works well with Oxygen despite not having a theme. You save your blocks in a directory called /fake/blocks/

Now I am not sure if blocklab or oxygen is the one adding the fake part of the URL, but if it is then Oxygen is causing problems.

If you want to inject a custom CSS for your block you create a CSS file named the same as the block:
/fake/blocks/my-block.php and /fake/blocks/my-block.css

According to this blog post: https://getblocklab.com/new-feature-a-better-way-of-handling-block-styling-css/

The problem when doing this is when Oxygen injects the CSS in the footer it does not append a '/' after the site URL, so the CSS stylesheet will 404:

<link rel='stylesheet' id='block-lab__block-myblock-css' href='https://example.comfake/blocks/block-myblock.css?ver=1.0.0' type='text/css' media='all' />

Notice the example.comfake part.

Are you able to replicate the issue on a Sandbox install at https://oxygenbuilder.com/try?

Yes

To Reproduce

  1. Install Block Lab plugin
  2. Create a new block
  3. Create a PHP file for the block in /fake/blocks/myblock.php
  4. Create a CSS file for the block in /fake/blocks/myblock.css

Expected behavior

Inject CSS with / after the domain name to access the CSS file.

What actually happens

Injecting without slash and CSS file will 404.

@Zyles
Copy link
Author

Zyles commented Jul 29, 2020

Seems to be a Blocklab issue.

@Zyles Zyles closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant