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

Migrate static plugins with options to CSS #14700

Merged

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented Oct 17, 2024

This PR extends our JS configuration to CSS migration by also allowing plugins with options.

An example of such config would be:

import { type Config } from 'tailwindcss'
import myPlugin from "./myPlugin";

export default {
  plugins: [
    myPlugin({
      class: "tw",
    }),
  ],
} satisfies Config;

If the option object contains only values allowed in our CSS API, we can convert this to CSS entirely:

@plugin './myPlugin' {
  class: 'tw';
}

Copy link
Member Author

philipp-spiess commented Oct 17, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @philipp-spiess and the rest of your teammates on Graphite Graphite

@philipp-spiess philipp-spiess force-pushed the 10-17-include_simple_config_objects_when_extracting_static_plugins branch from c0e6536 to 20d0c57 Compare October 17, 2024 13:19
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch from f13c00d to 9a66a68 Compare October 17, 2024 13:19
@philipp-spiess philipp-spiess force-pushed the 10-17-include_simple_config_objects_when_extracting_static_plugins branch from 20d0c57 to 438c487 Compare October 17, 2024 13:22
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch from 9a66a68 to f54c6bf Compare October 17, 2024 13:24
@philipp-spiess philipp-spiess marked this pull request as ready for review October 17, 2024 13:28
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch from f54c6bf to a0d1616 Compare October 17, 2024 13:28
@philipp-spiess philipp-spiess force-pushed the 10-17-include_simple_config_objects_when_extracting_static_plugins branch from 438c487 to aab02ca Compare October 17, 2024 13:32
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch 2 times, most recently from 3ca31c4 to 10abcec Compare October 17, 2024 13:39
await format(node.toString(), {
parser: 'css',
semi: true,
singleQuote: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that we inconsistently used single quotes for the @plugin and @config directives but double-quotes for CSS values so this is just a consistency change.

@philipp-spiess philipp-spiess requested a review from a team October 17, 2024 13:40
@philipp-spiess philipp-spiess force-pushed the 10-17-include_simple_config_objects_when_extracting_static_plugins branch from aab02ca to 09c0aab Compare October 17, 2024 13:41
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch from 10abcec to ea4e2bd Compare October 17, 2024 13:41
@philipp-spiess philipp-spiess force-pushed the 10-17-include_simple_config_objects_when_extracting_static_plugins branch from 09c0aab to 3c0528a Compare October 17, 2024 14:51
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch from ea4e2bd to ab2514d Compare October 17, 2024 14:51
@philipp-spiess philipp-spiess force-pushed the 10-17-include_simple_config_objects_when_extracting_static_plugins branch from d775256 to 34fc9b0 Compare October 18, 2024 11:08
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch 3 times, most recently from a45db82 to 9f6e422 Compare October 18, 2024 11:25
Copy link
Member Author

philipp-spiess commented Oct 18, 2024

Merge activity

  • Oct 18, 9:10 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 18, 9:12 AM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 18, 9:16 AM EDT: A user merged this pull request with Graphite.

Base automatically changed from 10-17-include_simple_config_objects_when_extracting_static_plugins to next October 18, 2024 13:10
@philipp-spiess philipp-spiess force-pushed the 10-17-migrate_static_plugins_with_options_to_css branch from 9f6e422 to d45b2ec Compare October 18, 2024 13:11
@philipp-spiess philipp-spiess merged commit 3da49f9 into next Oct 18, 2024
2 checks passed
@philipp-spiess philipp-spiess deleted the 10-17-migrate_static_plugins_with_options_to_css branch October 18, 2024 13:16
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

Successfully merging this pull request may close these issues.

3 participants