Skip to content

Commit

Permalink
- moving all styling out of package
Browse files Browse the repository at this point in the history
- change tailwind config to be an example that they can copy
- add resources/css/app.css to head-end.blade.php
  • Loading branch information
joshtorres committed Feb 10, 2024
1 parent bf4808d commit c6de6fc
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 72 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"filament/spatie-laravel-settings-plugin": "^3.0",
"filament/spatie-laravel-tags-plugin": "^3.0-stable",
"filament/spatie-laravel-translatable-plugin": "^3.0-stable",
"filament/support": "^3.2",
"google/apiclient": "^2.15",
"illuminate/contracts": "^10.0",
"illuminate/database": "^10.0",
Expand Down
12 changes: 0 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@
"private": true,
"type": "module",
"scripts": {
"dev:core-styles": "npx tailwind -i resources/css/index.css -o resources/dist/catalyst-core-plugin.css --postcss --watch",
"dev:admin-styles": "npx tailwind -i resources/css/filament/admin/theme.css -o resources/dist/catalyst-admin.css --postcss --watch",
"dev:social-styles": "npx tailwind -i resources/css/filament/social/theme.css -o resources/dist/catalyst-social.css --postcss --watch",
"dev:jobs-styles": "npx tailwind -i resources/css/filament/jobs/theme.css -o resources/dist/catalyst-jobs.css --postcss --watch",
"dev:scripts": "node bin/build.js --dev",
"build:core-styles": "npx tailwind -i resources/css/index.css -o resources/dist/catalyst-core-plugin.css --postcss --minify && npm run purge",
"build:admin-styles": "npx tailwind -i resources/css/filament/admin/theme.css -o resources/dist/catalyst-admin.css --postcss --minify && npm run purge",
"build:social-styles": "npx tailwind -i resources/css/filament/social/theme.css -o resources/dist/catalyst-social.css --postcss --minify && npm run purge",
"build:jobs-styles": "npx tailwind -i resources/css/filament/jobs/theme.css -o resources/dist/catalyst-core-jobs.css --postcss --minify && npm run purge",
"build:scripts": "node bin/build.js",
"purge:core-styles": "filament-purge -i resources/dist/catalyst-core-plugin.css -o resources/dist/catalyst-core-plugin.css -v 3.x",
"purge:admin-styles": "filament-purge -i resources/dist/catalyst-admin.css -o resources/dist/catalyst-admin.css -v 3.x",
"purge:social-styles": "filament-purge -i resources/dist/catalyst-social.css -o resources/dist/catalyst-social.css -v 3.x",
"purge:jobs-styles": "filament-purge -i resources/dist/catalyst-jobs.css -o resources/dist/catalyst-jobs.css -v 3.x",
"purge": "npm-run-all purge:*",
"dev": "npm-run-all --parallel dev:*",
"build": "npm-run-all build:*"
Expand Down
8 changes: 1 addition & 7 deletions resources/views/layouts/partials/head-end.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{{--<script src="https://cdn.tailwindcss.com"></script>--}}

{{--@filamentStyles--}}
@libraryStyles
@include('catalyst::components.layouts.partials.fontawesome')
{{--@vite(['public/css/omnia-digital/catalyst-core-plugin/catalyst-core-plugin-styles.css'])--}}
{{--@vite(['public/css/omnia-digital/catalyst-core-plugin/catalyst-social-styles.css'])--}}
{{--@vite(['public/css/omnia-digital/catalyst-core-plugin/catalyst-admin-styles.css'])--}}
{{--@vite(['public/css/omnia-digital/catalyst-core-plugin/catalyst-jobs-styles.css'])--}}
@vite(['resources/css/app.css'])
@stack('styles')
17 changes: 4 additions & 13 deletions src/CatalystCoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Filament\Support\Assets\Js;
use Filament\Support\Assets\Theme;
use Filament\Support\Facades\FilamentAsset;
use Filament\Support\Facades\FilamentColor;
use Filament\Support\Facades\FilamentIcon;
use Filament\Support\Facades\FilamentView;
use Illuminate\Filesystem\Filesystem;
Expand Down Expand Up @@ -49,14 +48,10 @@ class CatalystCoreServiceProvider extends PackageServiceProvider

public function configurePackage(Package $package): void
{
/*
* This class is a Package Service Provider
*
* More info: https://github.com/spatie/laravel-package-tools
*/
$package->name(static::$name)
->hasCommands($this->getCommands())
->hasRoutes($this->getRoutes())
->hasViews()
->hasInstallCommand(function (InstallCommand $command) {
$command
->publishConfigFile()
Expand Down Expand Up @@ -290,8 +285,8 @@ private function registerSingleLivewireComponent(string $class, string $namespac
public function packageRegistered(): void
{
$this->app->register(LivewireServiceProvider::class);
$this->app->register(AdminPanelProvider::class);
$this->app->register(SocialPanelProvider::class);
// $this->app->register(AdminPanelProvider::class);
// $this->app->register(SocialPanelProvider::class);
$this->app->register(JobsPanelProvider::class);
$this->app->register(StripeConnectServiceProvider::class);
$this->app->register(TeamLensesServiceProvider::class);
Expand Down Expand Up @@ -376,11 +371,7 @@ protected function getAssets(): array
{
return [
// AlpineComponent::make('catalyst-core-plugin', __DIR__ . '/../resources/dist/components/catalyst-core-plugin.js'),
// Css::make('catalyst-core-plugin-styles', __DIR__ . '/../resources/dist/catalyst-core-plugin.css')->loadedOnRequest(),
// Css::make('catalyst-admin-styles', __DIR__ . '/../resources/dist/catalyst-admin.css')->loadedOnRequest(),
// Css::make('catalyst-social-styles', __DIR__ . '/../resources/dist/catalyst-social.css')->loadedOnRequest(),
// Css::make('catalyst-jobs-styles', __DIR__ . '/../resources/dist/catalyst-jobs.css')->loadedOnRequest(),

// Css::make('catalyst-core-plugin-styles', __DIR__ . '/../resources/dist/catalyst-core-plugin.css'),
Js::make('catalyst-core-plugin-scripts', __DIR__ . '/../resources/dist/catalyst-core-plugin.js'),
];
}
Expand Down
4 changes: 0 additions & 4 deletions src/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
Expand All @@ -28,9 +27,6 @@ public function panel(Panel $panel): Panel
->id('admin')
->path('admin')
->login()
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: __DIR__ . '/../../Filament/Admin/Resources',
for: 'OmniaDigital\\CatalystCore\\Filament\\Admin\\Resources')
->discoverPages(in: __DIR__ . '/../../Filament/Admin/Pages/',
Expand Down
21 changes: 4 additions & 17 deletions src/Providers/Filament/JobsPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ public function panel(Panel $panel): Panel
->id('jobs')
->path('jobs')
->login()
->colors([
'primary' => Color::Amber,
'danger' => Color::Rose,
'gray' => Color::Gray,
'info' => Color::Blue,
'success' => Color::Emerald,
'warning' => Color::Orange,
])
->discoverResources(
in: __DIR__ . '/../../Filament/Jobs/Resources',
for: 'OmniaDigital\\CatalystCore\\Filament\\Jobs\\Resources'
Expand All @@ -41,19 +33,14 @@ public function panel(Panel $panel): Panel
in: __DIR__ . '/../../Filament/Jobs/Pages',
for: 'OmniaDigital\\CatalystCore\\Filament\\Jobs\\Pages'
)
// ->pages([
// Home::class
// // Pages\Dashboard::class,
// ])

->discoverWidgets(
in: '../../Filament/Jobs/Widgets',
for: 'OmniaDigital\\CatalystCore\\Filament\\Jobs\\Widgets'
)
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
// ->widgets([
// Widgets\AccountWidget::class,
// Widgets\FilamentInfoWidget::class,
// ])
// ->topNavigation()
// ->sidebarCollapsibleOnDesktop()
// Render Hooks for Jobs
Expand Down
9 changes: 0 additions & 9 deletions src/Providers/Filament/SocialPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Filament\Navigation\NavigationItem;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
Expand All @@ -34,14 +33,6 @@ public function panel(Panel $panel): Panel
->id('social')
->path('social')
->login()
->colors([
'primary' => Color::Orange,
'danger' => Color::Rose,
'gray' => Color::Gray,
'info' => Color::Blue,
'success' => Color::Emerald,
'warning' => Color::Orange,
])
->discoverResources(
in: __DIR__ . '/../../Filament/Social/Resources',
for: 'OmniaDigital\\CatalystCore\\Filament\\Social\\Resources'
Expand Down
169 changes: 169 additions & 0 deletions tailwind.config.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
const plugin = require('tailwindcss/plugin');
const defaultTheme = require('tailwindcss/defaultTheme');
const colors = require('tailwindcss/colors')
import preset from './vendor/filament/filament/tailwind.config.preset'

module.exports = {
presets: [preset],
content: [
'./vendor/omnia-digital/catalyst-core-plugin/resources/views/**/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./vendor/laravel/jetstream/**/*.blade.php',
'./vendor/omnia-digital/library/resources/views/**/*.blade.php',
'./vendor/omnia-digital/library/resources/js/**/*.js',
'./vendor/omnia-digital/media-manager/resources/views/**/*.blade.php',
'./node_modules/tw-elements/dist/js/**/*.js'
],

theme: {
themeVariants: [
'default',
'dark',
'hatchet',
'cfanea',
'newyear',
'valentines',
'patrick',
'easter',
'spring',
'summer',
'independence',
'fall',
'halloween',
'christmas',
'winter'
],
extend: {
fontFamily: {
sans: ["SF Pro Display", "Helvetica", "Roboto", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Arial", "sans-serif", ...defaultTheme.fontFamily.sans],
},
fontSize: {
'dot': '.15rem',
'2xs': '0.65rem',
'3xs': '0.55rem',
'base': '0.9375rem',
},
height: {
'13': '3.2rem',
'full-with-nav': 'calc(100vh - 56px)'
},
maxWidth: {
'sm': '22rem',
'2xl': '40rem',
'8xl': '82rem',
'9xl': '90rem',
'post-card-max-w': '680px'
},
colors: {
'base-text-color': 'var(--base-text-color)',
'white-text-color': 'var(--white-text-color)',
'light-text-color': 'var(--light-text-color)',
'dark-text-color': 'var(--dark-text-color)',
neutral: {
DEFAULT: 'var(--neutral)',
'light': 'var(--neutral-light)',
'dark': 'var(--neutral-dark)',
'hover': 'var(--neutral-hover)',
},
primary: {
DEFAULT: process.env.PRIMARY_COLOR || 'var(--primary)',
"50": "var(--primary-50)",
"100": "var(--primary-100)",
"200": "var(--primary-200)",
"300": "var(--primary-300)",
"400": "var(--primary-400)",
"500": process.env.PRIMARY_COLOR_500 || process.env.PRIMARY_COLOR || "var(--primary-500)" || "var(--primary)",
"600": "var(--primary-600)",
"700": "var(--primary-700)",
"800": "var(--primary-800)",
"900": "var(--primary-900)"
},
secondary: {
DEFAULT: process.env.SECONDARY_COLOR || 'var(--secondary)',
"50": "var(--secondary-50)",
"100": "var(--secondary-100)",
"200": "var(--secondary-200)",
"300": "var(--secondary-300)",
"400": "var(--secondary-400)",
"500": "var(--secondary-500)",
"600": "var(--secondary-600)",
"700": "var(--secondary-700)",
"800": "var(--secondary-800)",
"900": "var(--secondary-900)"
},
tertiary: {
DEFAULT: process.env.TERTIARY_COLOR || 'var(--tertiary)',
"50": "var(--tertiary-50)",
"100": "var(--tertiary-100)",
"200": "var(--tertiary-200)",
"300": "var(--tertiary-300)",
"400": "var(--tertiary-400)",
"500": "var(--tertiary-500)",
"600": "var(--tertiary-600)",
"700": "var(--tertiary-700)",
"800": "var(--tertiary-800)",
"900": "var(--tertiary-900)"
},
danger: colors.rose,
success: colors.green,
warning: colors.yellow,
'main-nav-active-hover-text-color': 'var(--main-nav-active-hover-text-color)',
'main-nav-active-text-color': 'var(--main-nav-active-text-color)',
'main-nav-active-bg-color': 'var(--main-nav-active-bg-color)',
'main-nav-text-color': 'var(--main-nav-text-color)',
'main-nav-hover-text-color': 'var(--main-nav-hover-text-color)',
'main-nav-hover-bg-color': 'var(--main-nav-hover-bg-color)',
'post-card-bg-color': 'var(--post-card-bg-color)',
'post-card-border-color': 'var(--post-card-border-color)',
'post-card-border-hover-color': 'var(--post-card-border-hover-color)',
'post-card-title-color': 'var(--post-card-title-color)',
'post-card-meta-color': 'var(--post-card-meta-color)',
'post-card-body-color': 'var(--post-card-body-color)',
'post-card-shadows': 'var(--post-card-shadows)',
'heading-default-color': 'var(--heading-default-color)',
'h1-color': 'var(--h1-color)',
'h2-color': 'var(--h2-color)',
'h3-color': 'var(--h3-color)',
'h4-color': 'var(--h4-color)',
'h5-color': 'var(--h5-color)',
'h6-color': 'var(--h6-color)',
}
}
},

variants: {
extend: {
textOpacity: ['dark'],
display: ["group-hover"]
}
},

plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
/* require('tailwindcss-multi-theme'), */
require('@tailwindcss/aspect-ratio'),
require('tailwind-scrollbar-hide'),
require('tw-elements/dist/plugin'),
plugin(function ({matchUtilities, theme}) {
matchUtilities(
{
'h-full-minus': (value) => {
return {
height: 'calc(100vh - ' + value + ')',
}
},
'max-h-full-minus': (value) => {
return {
maxHeight: 'calc(100vh - ' + value + ')',
}
},
},
)
}),
]
};

10 changes: 0 additions & 10 deletions tailwind.config.js

This file was deleted.

0 comments on commit c6de6fc

Please sign in to comment.