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

Scripts: Control Directives for RTLCSS don't work in build command #68364

Open
2 of 6 tasks
t-hamano opened this issue Dec 28, 2024 · 1 comment
Open
2 of 6 tasks

Scripts: Control Directives for RTLCSS don't work in build command #68364

t-hamano opened this issue Dec 28, 2024 · 1 comment
Labels
[Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

Description

In #61540, wp-scripts supported CSS for RTL languages. Also, with RTLCSS, you can add some processing via the Control Directives.

However, this Control Directives does not seem to work with the build command.

I thought that #68201 might be affecting this, but it seems that's not the case. I don't know if the control directives were not working from the beginning.

cc @gziolo @ryelle

Step-by-step reproduction instructions

Use the following command to create a block without wp-script:

npx wp-create-block my-block --no-wp-scripts
cd my-block

Update the my-block/src/editor.scss file as follows:

.wp-block-create-block-my-block {
	/*rtl:ignore*/
	text-align: left;
	/*rtl:remove*/
	background: #ccc;
}

✅ Run ../node_modules/.bin/wp-scripts start and check the build file. Confirm that the controls directive is working.

index.css:

.wp-block-create-block-my-block {
  /*rtl:ignore*/
  text-align: left;
  /*rtl:remove*/
  background: #ccc;
}

index-rtl.css:

.wp-block-create-block-my-block {
  text-align: left;
}

❌ Run ../node_modules/.bin/wp-scripts build and check the build file. Confirm that the controls directive is NOT working.

index.css:

.wp-block-create-block-my-block{
	background:#ccc;
	text-align:left
}

index-rtl.css:

.wp-block-create-block-my-block{
	background:#ccc;
	text-align:right
}

Screenshots, screen recording, code snippet

b57b77409fdef37f9e0aea1bd2260107.mp4

Environment info

OS: WSL2 (Ubuntu 22.04.4 LTS)

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@t-hamano t-hamano added [Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended labels Dec 28, 2024
@t-hamano t-hamano changed the title Scripts: Contril Directives for RTLCSS don't work in build command Scripts: Control Directives for RTLCSS don't work in build command Dec 28, 2024
@Rishit30G
Copy link
Contributor

I can confirm that the issue is present, sharing the screencast for the same:
https://github.com/user-attachments/assets/e39e92da-825c-445e-a429-4bc5fbf70dbb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants