Skip to content

Commit

Permalink
fix: clean up usages of variation and appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Mar 16, 2023
1 parent 7fd4a11 commit e8e0c9b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
:aria-label="$gettext(indicator.label)"
:aria-describedby="getIndicatorDescriptionId(indicator)"
appearance="raw-inverse"
variation="primary"
:data-testid="indicator.id"
:data-test-indicator-type="indicator.type"
@click="indicator.handler(resource, indicator.target, $router)"
>
<oc-icon :name="indicator.icon" size="small" fill-type="line" />
<oc-icon :name="indicator.icon" size="small" fill-type="line" variation="inherit" />
</oc-button>
<oc-icon
v-else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
:to="navItem.to"
:class="{ 'oc-background-primary-gradient': navItem.active }"
:appearance="navItem.active ? 'raw-inverse' : 'raw'"
:variation="navItem.active ? 'primary' : 'passive'"
>
<span class="icon-box" :class="{ 'icon-box-active': navItem.active }">
<oc-icon :name="navItem.icon" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@
<oc-button
:id="`files-recipient-role-drop-btn-${role.name}`"
ref="roleSelect"
appearance="raw"
justify-content="space-between"
class="files-recipient-role-drop-btn oc-p-s"
:class="{
'oc-background-primary-gradient': isSelectedRole(role),
selected: isSelectedRole(role)
}"
:variation="isSelectedRole(role) ? 'inverse' : 'passive'"
:appearance="isSelectedRole(role) ? 'raw-inverse' : 'raw'"
:variation="isSelectedRole(role) ? 'primary' : 'passive'"
@click="selectRole(role)"
>
<span class="oc-flex oc-flex-middle">
<oc-icon :name="role.icon" class="oc-pl-s oc-pr-m" />
<oc-icon :name="role.icon" class="oc-pl-s oc-pr-m" variation="inherit" />
<role-item
:role="role"
:allow-share-permission="allowSharePermission && resharingDefault"
/>
</span>
<span class="oc-flex">
<oc-icon v-if="isSelectedRole(role)" name="check" />
<oc-icon v-if="isSelectedRole(role)" name="check" variation="inherit" />
</span>
</oc-button>
</li>
Expand Down Expand Up @@ -272,7 +272,7 @@ export default defineComponent({
this.publishChange()
},
isSelectedRole(role) {
isSelectedRole(role: ShareRole) {
return this.selectedRole.name === role.name
},
Expand Down Expand Up @@ -367,15 +367,6 @@ export default defineComponent({
width: 400px;
&-list {
&:hover .files-recipient-role-drop-btn.selected:not(:hover),
&:focus .files-recipient-role-drop-btn.selected:not(:focus) {
color: var(--oc-color-swatch-passive-default);
::v-deep .oc-icon > svg {
fill: var(--oc-color-swatch-passive-default);
}
}
li {
margin: var(--oc-space-xsmall) 0;
}
Expand All @@ -388,17 +379,8 @@ export default defineComponent({
&:hover,
&:focus {
background-color: var(--oc-color-background-hover);
color: var(--oc-color-swatch-passive-default);
text-decoration: none;
}
&.selected {
color: var(--oc-color-swatch-passive-contrast) !important;
::v-deep .oc-icon > svg {
fill: var(--oc-color-swatch-passive-contrast) !important;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@
mode="click"
>
<oc-list class="roleDropdownList">
<li
v-for="roleOption in availableRoleOptions"
:key="`role-dropdown-${roleOption.label.toLowerCase()}`"
>
<li v-for="roleOption in availableRoleOptions" :key="`role-dropdown-${roleOption.key}`">
<oc-button
:id="`files-role-${roleOption.label.toLowerCase()}`"
:id="`files-role-${roleOption.key}`"
:class="{
selected: link.permissions === roleOption.bitmask(false),
'oc-background-primary-gradient': link.permissions === roleOption.bitmask(false)
selected: isSelectedRole(roleOption),
'oc-background-primary-gradient': isSelectedRole(roleOption)
}"
appearance="raw"
:variation="link.permissions === roleOption.bitmask(false) ? 'inverse' : 'passive'"
:appearance="isSelectedRole(roleOption) ? 'raw-inverse' : 'raw'"
:variation="isSelectedRole(roleOption) ? 'primary' : 'passive'"
justify-content="space-between"
class="oc-p-s"
@click="
Expand All @@ -45,7 +42,7 @@
"
>
<span class="oc-flex oc-flex-middle">
<oc-icon :name="roleOption.icon" class="oc-pl-s oc-pr-m" />
<oc-icon :name="roleOption.icon" class="oc-pl-s oc-pr-m" variation="inherit" />
<span>
<span
class="oc-text-bold oc-display-block oc-width-1-1"
Expand All @@ -55,7 +52,7 @@
</span>
</span>
<span class="oc-flex">
<oc-icon v-if="link.permissions === roleOption.bitmask(false)" name="check" />
<oc-icon v-if="isSelectedRole(roleOption)" name="check" variation="inherit" />
</span>
</oc-button>
</li>
Expand Down Expand Up @@ -402,6 +399,10 @@ export default defineComponent({
methods: {
...mapActions(['createModal', 'hideModal', 'setModalInputErrorMessage']),
isSelectedRole(role: ShareRole) {
return this.link.permissions === role.bitmask(false)
},
updateLink({
link = this.link,
dropRef = this.$refs.editPublicLinkDropdown,
Expand Down Expand Up @@ -503,17 +504,8 @@ export default defineComponent({
&:hover,
&:focus {
background-color: var(--oc-color-background-hover);
color: var(--oc-color-swatch-passive-default);
text-decoration: none;
}
&.selected {
color: var(--oc-color-swatch-passive-contrast) !important;
::v-deep .oc-icon > svg {
fill: var(--oc-color-swatch-passive-contrast) !important;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:data-nav-name="navName"
>
<span class="oc-flex">
<oc-icon :name="icon" :fill-type="fillType" />
<oc-icon :name="icon" :fill-type="fillType" variation="inherit" />
<span class="oc-ml-m text" :class="{ 'text-invisible': collapsed }" v-text="name" />
</span>
<oc-tag v-if="tag" class="oc-py-rm" size="small">{{ tag }}</oc-tag>
Expand Down
13 changes: 2 additions & 11 deletions packages/web-runtime/src/components/Topbar/ApplicationsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
:class="{ 'oc-background-primary-gradient router-link-active': n.active }"
>
<span class="icon-box">
<oc-icon :name="n.icon" />
<oc-icon :name="n.icon" variation="inherit" />
</span>
<span v-text="$gettext(n.title)" />
<oc-icon v-if="n.active" name="check" class="active-check" />
<oc-icon v-if="n.active" name="check" class="active-check" variation="inherit" />
</oc-button>
</li>
</oc-list>
Expand Down Expand Up @@ -104,7 +104,6 @@ export default defineComponent({
&:focus,
&:hover {
background-color: var(--oc-color-background-hover);
color: var(--oc-color-swatch-passive-default);
text-decoration: none;
}
Expand All @@ -121,13 +120,5 @@ export default defineComponent({
right: 1rem;
}
}
a.router-link-active,
button.router-link-active {
&:focus,
&:hover {
color: var(--oc-color-swatch-passive-contrast);
}
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@click="toggleTheme"
>
<span class="oc-visible@s" :aria-label="switchLabel" />
<oc-icon :name="switchIcon" fill-type="line" />
<oc-icon :name="switchIcon" fill-type="line" variation="inherit" />
</oc-button>
</template>
<script lang="ts">
Expand Down

0 comments on commit e8e0c9b

Please sign in to comment.