Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Jan 17, 2025
1 parent 7f6a300 commit d1d68ee
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
5 changes: 3 additions & 2 deletions panel/src/components/Collection/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div
v-bind="data"
:class="['k-item', `k-${layout}-item`, $attrs.class]"
:data-has-image="hasFigure"
:data-layout="layout"
:data-theme="theme"
:style="$attrs.style"
Expand Down Expand Up @@ -210,7 +211,7 @@ export default {
align-items: center;
grid-template-columns: 1fr auto;
}
.k-item[data-layout="list"]:has(.k-item-image) {
.k-item[data-layout="list"][data-has-image="true"] {
grid-template-columns: var(--item-height) 1fr auto;
}
.k-item[data-layout="list"] .k-frame {
Expand Down Expand Up @@ -269,7 +270,7 @@ export default {
grid-template-columns: 1fr;
grid-template-rows: 1fr var(--height-md);
}
.k-item[data-layout="cardlets"]:has(.k-item-image) {
.k-item[data-layout="cardlets"][data-has-image="true"] {
grid-template-areas:
"image content"
"image options";
Expand Down
5 changes: 1 addition & 4 deletions panel/src/components/Forms/Field/BlocksField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ export default {
.k-blocks-field > footer {
display: flex;
justify-content: center;
}
.k-blocks-field > :has(+ footer) {
margin-bottom: var(--spacing-3);
margin-top: var(--spacing-3);
}
</style>
4 changes: 2 additions & 2 deletions panel/src/components/Forms/Field/DateField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:input="id"
:style="$attrs.style"
>
<div ref="body" class="k-date-field-body">
<div ref="body" :data-has-time="Boolean(time)" class="k-date-field-body">
<!-- Date input -->
<k-input
ref="dateInput"
Expand Down Expand Up @@ -242,7 +242,7 @@ export default {
}
@container (min-width: 20rem) {
.k-date-field-body:has(.k-time-input) {
.k-date-field-body[data-has-time="true"] {
grid-template-columns: 1fr minmax(6rem, 9rem);
}
}
Expand Down
4 changes: 1 addition & 3 deletions panel/src/components/Forms/Field/LayoutField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ export default {
.k-layout-field > footer {
display: flex;
justify-content: center;
}
.k-layout-field > :has(+ footer) {
margin-bottom: var(--spacing-3);
margin-top: var(--spacing-3);
}
</style>
4 changes: 1 addition & 3 deletions panel/src/components/Forms/Field/StructureField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,6 @@ export default {
.k-structure-field .k-table + footer {
display: flex;
justify-content: center;
}
.k-structure-field .k-table:has(+ footer) {
margin-bottom: var(--spacing-3);
margin-top: var(--spacing-3);
}
</style>
2 changes: 1 addition & 1 deletion panel/src/components/Lab/PlaygroundView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default {
</script>

<style>
.k-lab-playground-view:has(.k-tabs) .k-lab-playground-header {
.k-lab-playground-view:has(> .k-tabs) .k-lab-playground-header {
margin-bottom: 0;
}
Expand Down
10 changes: 6 additions & 4 deletions panel/src/components/Navigation/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
:is="component"
v-bind="attrs"
:class="['k-button', $attrs.class]"
:data-has-icon="Boolean(icon)"
:data-has-text="Boolean(text || $slots.default)"
:style="$attrs.style"
@click="onClick"
>
Expand Down Expand Up @@ -325,22 +327,22 @@ export default {
}
/** Icon Buttons **/
.k-button:not(:has(.k-button-text)) {
.k-button:not([data-has-text="true"]) {
--button-padding: 0;
aspect-ratio: 1/1;
}
/** Responsive buttons **/
@container (max-width: 30rem) {
.k-button:is([data-responsive]:has(.k-button-icon)) {
.k-button[data-responsive="true"][data-has-icon="true"] {
--button-padding: 0;
aspect-ratio: 1/1;
--button-text-display: none;
}
.k-button[data-responsive="text"]:has(.k-button-text) {
.k-button[data-responsive="text"][data-has-text="true"] {
--button-icon-display: none;
}
.k-button:is([data-responsive]:has(.k-button-icon)) .k-button-arrow {
.k-button[data-responsive="true"][data-has-icon="true"] .k-button-arrow {
display: none;
}
}
Expand Down
3 changes: 2 additions & 1 deletion panel/src/components/Views/Files/FileView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<k-panel-inside
:data-has-tabs="hasTabs"
:data-id="id"
:data-locked="isLocked"
:data-template="blueprint"
Expand Down Expand Up @@ -89,7 +90,7 @@ export default {
border-bottom: 0;
}
.k-file-view:has(.k-tabs) .k-file-preview {
.k-file-view[data-has-tabs="true"] .k-file-preview {
margin-bottom: 0;
}
</style>
3 changes: 2 additions & 1 deletion panel/src/components/Views/Pages/PageView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<k-panel-inside
:data-has-tabs="hasTabs"
:data-id="id"
:data-locked="isLocked"
:data-template="blueprint"
Expand Down Expand Up @@ -57,7 +58,7 @@ export default {
</script>

<style>
.k-page-view:has(.k-tabs) .k-page-view-header {
.k-page-view[data-has-tabs="true"] .k-page-view-header {
margin-bottom: 0;
}
</style>
3 changes: 2 additions & 1 deletion panel/src/components/Views/Pages/SiteView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<k-panel-inside
:data-has-tabs="hasTabs"
:data-id="id"
:data-locked="isLocked"
:data-template="blueprint"
Expand Down Expand Up @@ -53,7 +54,7 @@ export default {
</script>

<style>
.k-site-view:has(.k-tabs) .k-site-view-header {
.k-site-view[data-has-tabs="true"] .k-site-view-header {
margin-bottom: 0;
}
</style>
3 changes: 2 additions & 1 deletion panel/src/components/Views/Users/UserView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<k-panel-inside
:data-has-tabs="hasTabs"
:data-id="id"
:data-locked="isLocked"
:data-template="blueprint"
Expand Down Expand Up @@ -97,7 +98,7 @@ export default {
.k-user-view .k-user-profile {
margin-bottom: var(--spacing-12);
}
.k-user-view:has(.k-tabs) .k-user-profile {
.k-user-view[data-has-tabs="true"] .k-user-profile {
margin-bottom: 0;
}
</style>

0 comments on commit d1d68ee

Please sign in to comment.