Skip to content

Commit

Permalink
[7.x] Dark Mode Support (#1077)
Browse files Browse the repository at this point in the history
* Shop icon should use `currentColor`

* Make the widget icons work with dark mode

* Make the product variants fieldtype dark mode compatible

* Remove unnecessary background from product variant select

* Make the status log compatible with dark mode

* Fix tax icon

* Fix border on tax navigation

* Fix icon
  • Loading branch information
duncanmcclean committed May 21, 2024
1 parent 3d77417 commit 5ba61ef
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="bg-white">
<div>
<div
v-if="initializing"
class="flex flex-col items-center justify-center text-center p-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
<div
v-for="(variant, variantIndex) in variants"
:key="variantIndex"
class="bg-grey-10 shadow-sm mb-4 rounded border variants-sortable-item"
class="replicator-set shadow-sm mb-4 rounded border dark:border-dark-900 testing-sortable-item variants-sortable-item"
>
<div class="grid-item-header rounded-t">
{{ variant.name || 'Variant' }}
<button
v-if="variants.length > 1"
class="icon icon-cross cursor-pointer"
@click="deleteVariant(variantIndex)"
:aria-label="__('Delete Variant')"
>
<svg-icon name="micro/trash" class="w-4 h-4 text-gray-600 group-hover:text-gray-900" />
</button>
<div class="replicator-set-header">
<div class="py-2 rtl:pr-2 ltr:pl-2 replicator-set-header-inner flex justify-between items-end w-full">
<label class="text-xs whitespace-nowrap rtl:ml-2 ltr:mr-2 cursor-pointer">
{{ variant.name || 'Variant' }}
</label>
<button
v-if="variants.length > 1"
class="icon icon-cross cursor-pointer"
@click="deleteVariant(variantIndex)"
:aria-label="__('Delete Variant')"
>
<svg-icon name="micro/trash" class="w-4 h-4 text-gray-600 group-hover:text-gray-900" />
</button>
</div>
</div>
<publish-fields-container>
<publish-field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<div class="bg-grey-10 shadow-sm mb-4 rounded border variants-sortable-item">
<div class="grid-item-header rounded-t">
{{ option.variant || __('Variants') }}
<div class="replicator-set shadow-sm mb-4 rounded border dark:border-dark-900 testing-sortable-item variants-sortable-item">
<div class="replicator-set-header">
<div class="py-2 rtl:pr-2 ltr:pl-2 replicator-set-header-inner flex justify-between items-end w-full">
<label class="text-xs whitespace-nowrap rtl:ml-2 ltr:mr-2 cursor-pointer">
{{ option.variant || __('Variants') }}
</label>
</div>
</div>

<publish-fields-container>
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/StatusLog/StatusLog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="bg-white h-full flex flex-col">
<div class="bg-gray-200 px-4 py-2 border-b border-gray-300 text-lg font-medium flex items-center justify-between">
<div class="bg-white dark:bg-dark-800 h-full flex flex-col">
<div class="bg-gray-200 dark:bg-dark-600 px-4 py-2 border-b border-gray-300 dark:border-dark-900 text-lg font-medium flex items-center justify-between">
{{ __('Status Log') }}
<button
type="button"
Expand All @@ -14,7 +14,7 @@
<loading-graphic />
</div>

<div v-if="!loading && statusLog.length === 0" class="p-4 text-gray text-sm">
<div v-if="!loading && statusLog.length === 0" class="p-4 text-gray dark:text-dark-150 text-sm">
{{ __('No status log events.') }}
</div>

Expand Down
2 changes: 1 addition & 1 deletion resources/svg/money-cash-file-dollar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/svg/shop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/views/cp/partials/tax-navigation.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="border-b px-2 text-sm flex">
<div class="border-b dark:border-dark-300 px-2 text-sm flex">
<a class="block data-list-filter-link @if(str_contains(Route::currentRouteName(), 'simple-commerce.tax-rates.index')) active @endif" href="{{ cp_route('simple-commerce.tax-rates.index') }}">
{{ __('Tax Rates') }}
</a>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/cp/tax-rates/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<template v-slot:trigger>
<button class="button btn-primary flex items-center pr-2">
{{ __('Create Tax Rate') }}
<svg-icon name="chevron-down-xs" class="w-2 ml-1" />
<svg-icon name="micro/chevron-down-xs" class="w-2 ml-1" />
</button>
</template>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/cp/widgets/low-stock-products.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="flex justify-between items-center p-4">
<h2>
<a class="flex items-center" href="{{ $url }}">
<div class="h-6 w-6 mr-2 text-gray-800">
<div class="h-6 w-6 mr-2 text-gray-800 dark:text-dark-100">
@cp_svg('icons/light/entries')
</div>
<span>{{ __('Low Stock Products') }}</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/cp/widgets/recent-orders.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="flex justify-between items-center p-4">
<h2>
<a class="flex items-center" href="{{ $url }}">
<div class="h-6 w-6 mr-2 text-gray-800">
<div class="h-6 w-6 mr-2 text-gray-800 dark:text-dark-100">
{!! \DuncanMcClean\SimpleCommerce\SimpleCommerce::svg('shop') !!}
</div>
<span>{{ __('Recent Orders') }}</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/cp/widgets/top-customers.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="flex justify-between items-center p-4">
<h2>
<a class="flex items-center" href="{{ $url }}">
<div class="h-6 w-6 mr-2 text-gray-800">
<div class="h-6 w-6 mr-2 text-gray-800 dark:text-dark-100">
@cp_svg('icons/light/user')
</div>
<span>{{ __('Top Customers') }}</span>
Expand Down

0 comments on commit 5ba61ef

Please sign in to comment.