Skip to content

Commit

Permalink
move config to base_path
Browse files Browse the repository at this point in the history
  • Loading branch information
vmitchell85 committed Aug 10, 2023
1 parent a5c63f1 commit e9ae64a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ composer require krakero/tailwind-fieldtype

## How to Use

Once you install the addon you will need to run `krakero:tailwind-config`. This command will look for the `tailwind.config.js` file located in your project root and generate a version for the fieldtype.
Once you install the addon you will need to run `krakero:tailwind-config`. This command will look for the `tailwind.config.js` file located in your project root and generate a `tailwind.config.php` file for use by all Tailwind Picker fields.

> **NOTES:**
> - If you make changes to your config file you will need to run this command again.
> - This package needs to run `npm install` in it's directory to be able to convert the config file
> - The `tailwind.config.php` file should be committed with your code.
> - This package needs to run `npm install` in its directory to be able to convert the config file
2 changes: 1 addition & 1 deletion resources/js/TailwindColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="text-sm">
<div v-if="meta.missing_file" class="text-red-500">
Tailwind config file not found. Did you run <code>php artisan kit:tailwind-config</code>?
Tailwind config file not found. Did you run <code>php artisan krakero:tailwind-config</code>?
</div>
<div v-else class="flex items-center mb-2" v-for="color in config.available_colors" :key="color">
<div class="w-24 text-right px-4">{{ color }}</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/TailwindConfigGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function handle()

$this->info('Converting tailwind config to PHP...');
$path_to_library = __DIR__ . '/../../../node_modules/@vendeka/tailwind-config-php/index.js';
$path_to_config = __DIR__ . '/../../../tailwind.config.php';
$path_to_config = base_path('tailwind.config.php');

if (File::exists($path_to_library)) {
$cmd = $path_to_library . ' -o ' . $path_to_config;
Expand Down
2 changes: 1 addition & 1 deletion src/Fieldtypes/TailwindPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function setTailwindColors()
private function loadTailwindConfig()
{
if (File::exists(__DIR__.'/../../tailwind.config.php')) {
$this->tailwind_config = require __DIR__.'/../../tailwind.config.php';
$this->tailwind_config = require base_path('tailwind.config.php');
$this->missing_file = false;
} else {
$this->tailwind_config = false;
Expand Down

0 comments on commit e9ae64a

Please sign in to comment.