Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
refactor: improve view-options component (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaur committed Sep 15, 2021
1 parent 7e85be4 commit a424818
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions resources/assets/css/_buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,12 @@ a.button-secondary {
.dark .button-icon-primary:hover {
@apply shadow-none;
}

.view-option-button {
@apply relative;
}
.view-option-button.active:not(:focus-visible)::before {
content: "";
@apply absolute bottom-0 left-0 right-0 bg-theme-primary-600;
height: 3px;
}
8 changes: 4 additions & 4 deletions resources/views/tables/view-options.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<button
type="button"
:class="{
'{{ $selectedClasses }} focus-visible:border-transparent': tableView === 'grid',
'{{ $selectedClasses }} active': tableView === 'grid',
'{{ $unselectedClasses }}': tableView !== 'grid',
}"
class="py-2 px-3 focus-visible:rounded border-b-3"
class="p-3 focus-visible:rounded view-option-button"
@click="tableView = 'grid'"
@if ($disabled) disabled @endif
>
Expand All @@ -22,10 +22,10 @@ class="py-2 px-3 focus-visible:rounded border-b-3"
<button
type="button"
:class="{
'{{ $selectedClasses }} focus-visible:border-transparent': tableView === 'list',
'{{ $selectedClasses }} active': tableView === 'list',
'{{ $unselectedClasses }}': tableView !== 'list',
}"
class="py-2 px-3 focus-visible:rounded border-b-3"
class="p-3 focus-visible:rounded view-option-button"
@click="tableView = 'list'"
@if ($disabled) disabled @endif
>
Expand Down

0 comments on commit a424818

Please sign in to comment.