Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show paging text when in box ( inverted colors) #4467

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,6 @@ defineProps({
</TableRow>
</template>
</Table>
<Pagination :currentPage="45" :totalPages="55" />
<Pagination :currentPage="45" :totalPages="55" :inverted="true" />
</ContentBlock>
</template>
1 change: 1 addition & 0 deletions apps/nuxt3-ssr/components/table/Content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ function setActiveSideModal(value: string) {
:totalPages="Math.ceil(count / pageSize)"
@update="setCurrentPage($event)"
:prevent-default="true"
:inverted="true"
/>
</ContentBlock>
</template>
1 change: 1 addition & 0 deletions apps/tailwind-components/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
--text-color-tooltip-hover-dark: var(--color-blue-500);
--text-color-tooltip-hover-light: var(--color-white);
--text-color-pagination: var(--color-white);
--text-color-pagination-inverted: var(--color-gray-400);
--text-color-pagination-input: var(--color-blue-800);
--text-color-pagination-hover: var(--color-white);
--text-color-footer-link: var(--color-yellow-500);
Expand Down
12 changes: 10 additions & 2 deletions apps/tailwind-components/components/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const props = withDefaults(
currentPage: number;
totalPages: number;
preventDefault?: boolean;
inverted?: boolean;
}>(),
{
preventDefault: false,
inverted: false,
}
);
const emit = defineEmits(["update"]);
Expand Down Expand Up @@ -77,7 +79,10 @@ function changeCurrentPage(event: Event) {
<li class="flex justify-center items-center">
<div class="px-4 tracking-widest sm:px-5">
<label :for="pageInputId" class="sr-only">go to specific page</label>
<span class="text-pagination">Page</span>
<span
:class="[inverted ? 'text-pagination-inverted' : 'text-pagination']"
>Page</span
>
</div>
<input
:id="pageInputId"
Expand All @@ -86,7 +91,10 @@ function changeCurrentPage(event: Event) {
@change="changeCurrentPage"
/>
<div class="px-4 tracking-widest sm:px-5 whitespace-nowrap">
<span class="text-pagination">OF {{ totalPages }}</span>
<span
:class="[inverted ? 'text-pagination-inverted' : 'text-pagination']"
>OF {{ totalPages }}</span
>
</div>
</li>
<li>
Expand Down
10 changes: 10 additions & 0 deletions apps/tailwind-components/pages/Pagination.story.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
:preventDefault="true"
@update="updatePage"
/>

<hr class="my-3" />

<span>inverted = true:</span>
<Pagination
:currentPage="1"
:totalPages="10"
:inverted="true"
@update="updatePage"
/>
</template>

<script setup lang="ts">
Expand Down
1 change: 1 addition & 0 deletions apps/tailwind-components/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ module.exports = {
"tooltip-hover-dark": "var(--text-color-tooltip-hover-dark)",
"tooltip-hover-light": "var(--text-color-tooltip-hover-light)",
"pagination": "var(--text-color-pagination)",
"pagination-inverted": "var(--text-color-pagination-inverted)",
"pagination-input": "var(--text-color-pagination-input)",
"pagination-hover": "var(--text-color-pagination-hover)",
"footer-link": "var(--text-color-footer-link)",
Expand Down
Loading