Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Source page uplift (#300)

sarayourfriend9b606b31ae99
diff --git a/src/components/TableSortIcon.vue b/src/components/TableSortIcon.vue
new file mode 100644
index 000000000..0d6cbe833
--- /dev/null
+++ b/src/components/TableSortIcon.vue
@@ -0,0 +1,43 @@
+<template>
+ <div class="flex flex-col" :class="[active ? activeClass : inactiveClass]">
+ <svg
+ width="12"
+ height="6"
+ viewBox="0 0 12 6"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ class="stroke-current mb-2"
+ >
+ <path d="M11 5L6 0.999999L1 5" stroke-width="1.5" />
+ </svg>
+
+ <svg
+ width="12"
+ height="6"
+ viewBox="0 0 12 6"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ class="stroke-current"
+ >
+ <path d="M1 1L6 5L11 1" stroke-width="1.5" />
+ </svg>
+ </div>
+</template>
+
+<script>
+export default {
+ name: 'TableSortIcon',
+ props: {
+ active: {
+ type: Boolean,
+ required: true,
+ },
+ },
+ data() {
+ return {
+ activeClass: 'text-dark-blue',
+ inactiveClass: 'text-gray',
+ }
+ },
+}
+</script>
diff --git a/src/pages/sources.vue b/src/pages/sources.vue
index ec85d9edf..6e9ac749d 100644
--- a/src/pages/sources.vue
+++ b/src/pages/sources.vue
@@ -84,7 +84,7 @@
<table
:aria-label="$t('about.aria.sources-table')"
role="region"
- class="table is-striped mt-4 mb-10"
+ class="table is-striped mt-4 mb-10 border border-admin-gray"
>
<thead>
<tr>
@@ -95,7 +95,7 @@
>
<span class="table-header-inner">
{{ $t('sources.providers.source') }}
- <span class="icon"><i class="icon sort" /></span>
+ <TableSortIcon :active="sort.field === 'display_name'" />
</span>
</th>
<th>{{ $t('sources.providers.domain') }}</th>
@@ -106,24 +106,24 @@
>
<span class="table-header-inner">
{{ $t('sources.providers.item') }}
- <span class="icon"><i class="icon sort" /></span>
+ <TableSortIcon :active="sort.field === 'image_count'" />
</span>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(imageProvider, index) in sortedProviders" :key="index">
- <td class="bold-cell">
+ <td class="font-semibold">
<a :href="`/search?source=${imageProvider.source_name}`">
{{ imageProvider.display_name }}
</a>
</td>
- <td class="bold-cell">
+ <td class="font-semibold">
<a :href="imageProvider.source_url">
{{ imageProvider.source_url }}
</a>
</td>
- <td class="number-cell">
+ <td class="number-cell font-semibold">
{{ getProviderImageCount(imageProvider.image_count) }}
</td>
</tr>
@@ -183,7 +183,7 @@ export default SourcePage
@import '~/styles/text-only-page.scss';
$table-border: 1px solid $color-light-gray;
-$table-border-radius: 4px;
+$table-border-radius: 2px;
.button.is-primary {
font-size: 1.1875rem;
@@ -225,9 +225,6 @@ $table-border-radius: 4px;
}
tr:last-child {
- td {
- border-bottom: $table-border;
- }
td:first-child {
border-bottom-left-radius: $table-border-radius;
}
@@ -236,20 +233,9 @@ $table-border-radius: 4px;
}
}
- td {
+ th:not(:first-child),
+ td:not(:first-child) {
border-left: $table-border;
}
-
- tr td:last-child {
- border-right: $table-border;
- }
-}
-
-.bold-cell {
- font-weight: 600;
-}
-
-.number-cell {
- font-weight: 500;
}
</style>
diff --git a/src/styles/components/table.sass b/src/styles/components/table.sass
index f7679c3a2..f23ea6596 100644
--- a/src/styles/components/table.sass
+++ b/src/styles/components/table.sass
@@ -13,7 +13,7 @@ $table-head-cell-color: $text-strong
$table-foot-cell-border-width: 2px 0 0
$table-foot-cell-color: $text-strong
-$table-head-background-color: $color-light-gray
+$table-head-background-color: #F0F0F1
$table-body-background-color: transparent
$table-foot-background-color: transparent
@@ -22,8 +22,8 @@ $table-row-hover-background-color: $color-white
$table-row-active-background-color: $primary
$table-row-active-color: $color-white
-$table-striped-row-even-background-color: #f5f5f5
-$table-striped-row-even-hover-background-color: #f5f5f5
+$table-striped-row-even-background-color: #F6F7F7
+$table-striped-row-even-hover-background-color: #F6F7F7
.table
+block
@@ -63,11 +63,11 @@ $table-striped-row-even-hover-background-color: #f5f5f5
border-color: $table-row-active-color
color: currentColor
thead
- background-color: $table-head-background-color
td,
th
border-width: $table-head-cell-border-width
color: $table-head-cell-color
+ background-color: $table-head-background-color
tfoot
background-color: $table-foot-background-color
td,
diff --git a/tailwind.config.js b/tailwind.config.js
index f8aeb3b6d..080fab5ea 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -34,6 +34,9 @@ module.exports = {
'light-gray': '#d8d8d8', // rgb(216, 216, 216)
white: 'white',
+ // WordPress
+ 'admin-gray': '#DCDCDE',
+
// Semi-transparent
'dark-charcoal-04': 'rgba(48, 39, 46, 0.04)',
'dark-charcoal-20': 'rgba(48, 39, 46, 0.2)',