diff --git a/defaultConfig.stub.js b/defaultConfig.stub.js index 04f1158b3..3731eb808 100644 --- a/defaultConfig.stub.js +++ b/defaultConfig.stub.js @@ -759,17 +759,17 @@ module.exports = { /* |----------------------------------------------------------------------------- - | Packages + | Options https://tailwindcss.com/docs/configuration#options |----------------------------------------------------------------------------- | - | Here is where you can define the configuration for any Tailwind packages - | you're using. These can be utility packs, component bundles, or even - | complete themes. You'll want to reference each package's - | documentation for a list of settings available for it. + | Here is where you can set your Tailwind configuration options. For more + | details about these options, visit the configuration options documentation. | */ - packages: { + options: { + prefix: '', + important: false, }, } diff --git a/docs/source/docs/configuration.blade.md b/docs/source/docs/configuration.blade.md index ee3ed52b9..351999806 100644 --- a/docs/source/docs/configuration.blade.md +++ b/docs/source/docs/configuration.blade.md @@ -28,6 +28,121 @@ Please see the [installation](/docs/installation#4-process-your-css-with-tailwin As you can see below, the default config file is heavily documented. Read through it to get a better understanding of how each section can be customized for your project. +
{!! str_replace('// var defaultConfig', 'var defaultConfig', file_get_contents(dirname(dirname(__DIR__)).'/defaultConfig.stub.js')) !!}
+
+## Options
+
+In addition to defining your project's design system, the configuration file can also be used for setting a variety of global options.
+
+These options are available under the top-level `options` key, located at the bottom of the configuration file by default.
+
+### Prefix
+
+The `prefix` option allows you to add a custom prefix to all of Tailwind's generated utility classes.
+
+This can be really useful when layering Tailwind on top of existing CSS where there might be naming conflicts.
+
+For example, you could add a `tw-` prefix by setting the `prefix` option like so:
+
```js
-{!! str_replace('// var defaultConfig', 'var defaultConfig', file_get_contents(dirname(dirname(__DIR__)).'/defaultConfig.stub.js')) !!}
+{
+ // ...
+ options: {
+ prefix: 'tw-',
+ // ...
+ }
+}
+```
+
+It's important to understand that this prefix is added to the beginning of each *utility* name, not to the entire class name.
+
+That means that classes with responsive or state prefixes like `sm:` or `hover:` will still have the responsive or state prefix *first*, with your custom prefix appearing after the colon:
+
+```html
+