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

refactor(frontend): prefix css variables (UI) #14739

Merged
merged 6 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions packages/frontend-embed/src/components/EmMediaBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ defineProps<{
display: flex;
align-items: center;
width: 100%;
padding: var(--margin);
padding: var(--MI_UI-margin);
margin-top: 4px;
border: 1px solid var(--MI_THEME-inputBorder);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
background-color: var(--MI_THEME-panel);
transition: background-color .1s, border-color .1s;

Expand Down
4 changes: 2 additions & 2 deletions packages/frontend-embed/src/components/EmMediaVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ defineProps<{
width: 100%;
height: auto;
aspect-ratio: 16 / 9;
padding: var(--margin);
padding: var(--MI_UI-margin);
border: 1px solid var(--MI_THEME-divider);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
background-color: #000;

&:hover {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend-embed/src/components/EmNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const isDeleted = ref(false);
width: calc(100% - 8px);
height: calc(100% - 8px);
border: dashed 2px var(--MI_THEME-focus);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
box-sizing: border-box;
}
}
Expand Down Expand Up @@ -430,7 +430,7 @@ const isDeleted = ref(false);

.translation {
border: solid 0.5px var(--MI_THEME-divider);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
padding: 12px;
margin-top: 8px;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/pages/clip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function top(ev: MouseEvent) {
display: flex;
min-width: 0;
align-items: center;
gap: var(--margin);
gap: var(--MI_UI-margin);
overflow: hidden;

.headerClipIconRoot {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/pages/tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function top(ev: MouseEvent) {
display: flex;
min-width: 0;
align-items: center;
gap: var(--margin);
gap: var(--MI_UI-margin);
overflow: hidden;

.headerClipIconRoot {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/pages/user-timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function top(ev: MouseEvent) {
display: flex;
min-width: 0;
align-items: center;
gap: var(--margin);
gap: var(--MI_UI-margin);
overflow: hidden;

.avatarLink {
Expand Down
22 changes: 11 additions & 11 deletions packages/frontend-embed/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/

:root {
--radius: 12px;
--marginFull: 14px;
--marginHalf: 10px;
--MI_UI-radius: 12px;
--MI_UI-marginFull: 14px;
--MI_UI-marginHalf: 10px;

--margin: var(--marginFull);
--MI_UI-margin: var(--MI_UI-marginFull);
}

html {
Expand Down Expand Up @@ -218,12 +218,12 @@ rt {

._panel {
background: var(--MI_THEME-panel);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
overflow: clip;
}

._margin {
margin: var(--margin) 0;
margin: var(--MI_UI-margin) 0;
}

._gaps_m {
Expand All @@ -241,7 +241,7 @@ rt {
._gaps {
display: flex;
flex-direction: column;
gap: var(--margin);
gap: var(--MI_UI-margin);
}

._buttons {
Expand All @@ -264,7 +264,7 @@ rt {
box-sizing: border-box;
text-align: center;
border: solid 0.5px var(--MI_THEME-divider);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);

&:active {
border-color: var(--MI_THEME-accent);
Expand All @@ -273,14 +273,14 @@ rt {

._popup {
background: var(--MI_THEME-popup);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
contain: content;
}

._acrylic {
background: var(--MI_THEME-acrylicPanel);
-webkit-backdrop-filter: var(--blur, blur(15px));
backdrop-filter: var(--blur, blur(15px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(15px));
backdrop-filter: var(--MI_UI-blur, blur(15px));
}

._fullinfo {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/ui.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ onUnmounted(() => {
height: auto;

&.rounded {
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
}

&.noBorder {
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/boot/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ export async function common(createVue: () => App<Element>) {
});

watch(defaultStore.reactiveState.useBlurEffectForModal, v => {
document.documentElement.style.setProperty('--modalBgFilter', v ? 'blur(4px)' : 'none');
document.documentElement.style.setProperty('--MI_UI-modalBgFilter', v ? 'blur(4px)' : 'none');
}, { immediate: true });

watch(defaultStore.reactiveState.useBlurEffect, v => {
if (v) {
document.documentElement.style.removeProperty('--blur');
document.documentElement.style.removeProperty('--MI_UI-blur');
} else {
document.documentElement.style.setProperty('--blur', 'none');
document.documentElement.style.setProperty('--MI_UI-blur', 'none');
}
}, { immediate: true });

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkAccountMoved.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ misskeyApi('users/show', { userId: props.movedTo }).then(u => user.value = u);
font-size: 90%;
background: var(--MI_THEME-infoWarnBg);
color: var(--MI_THEME-error);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
}

.link {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkAnnouncementDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ onMounted(() => {
max-width: 480px;
box-sizing: border-box;
background: var(--MI_THEME-panel);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
}

.header {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ onMounted(() => {
left: 0;
width: 100%;
height: 100%;
-webkit-backdrop-filter: var(--blur, blur(12px));
backdrop-filter: var(--blur, blur(12px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(12px));
backdrop-filter: var(--MI_UI-blur, blur(12px));
display: flex;
justify-content: center;
align-items: center;
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkCropperDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ onMounted(() => {
display: flex;
align-items: center;
justify-content: center;
-webkit-backdrop-filter: var(--blur, blur(10px));
backdrop-filter: var(--blur, blur(10px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(10px));
backdrop-filter: var(--MI_UI-blur, blur(10px));
background: rgba(0, 0, 0, 0.5);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function cancel() {
max-width: 100%;
height: 40cqh;
background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--MI_THEME-X5) 8px, var(--MI_THEME-X5) 14px);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
margin: auto;
overflow-y: hidden;
}
Expand All @@ -103,6 +103,6 @@ function cancel() {
padding: 3px 10px;
background-color: var(--MI_THEME-X5);
border: solid 1px var(--MI_THEME-divider);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
}
</style>
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkDateSeparatedList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default defineComponent({
}

&:not(.date-separated-list-nogap) > *:not(:last-child) {
margin-bottom: var(--margin);
margin-bottom: var(--MI_UI-margin);
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkDonation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ function neverShow() {
.root {
position: fixed;
z-index: v-bind(zIndex);
bottom: var(--margin);
bottom: var(--MI_UI-margin);
left: 0;
right: 0;
margin: auto;
box-sizing: border-box;
width: calc(100% - (var(--margin) * 2));
width: calc(100% - (var(--MI_UI-margin) * 2));
max-width: 500px;
display: flex;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkDrive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ onBeforeUnmount(() => {
.main {
flex: 1;
overflow: auto;
padding: var(--margin);
padding: var(--MI_UI-margin);
user-select: none;

&.fetching {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkExtensionInstaller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const emits = defineEmits<{

<style lang="scss" module>
.extInstallerRoot {
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
background: var(--MI_THEME-panel);
padding: 1.5rem;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkFoldableSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ onMounted(() => {
z-index: 10;
position: sticky;
top: var(--stickyTop, 0px);
-webkit-backdrop-filter: var(--blur, blur(8px));
backdrop-filter: var(--blur, blur(20px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(8px));
backdrop-filter: var(--MI_UI-blur, blur(20px));
}

.title {
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/components/MkFolder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ onMounted(() => {
box-sizing: border-box;
padding: 9px 12px 9px 12px;
background: var(--MI_THEME-folderHeaderBg);
-webkit-backdrop-filter: var(--blur, blur(15px));
backdrop-filter: var(--blur, blur(15px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(15px));
backdrop-filter: var(--MI_UI-blur, blur(15px));
border-radius: 6px;
transition: border-radius 0.3s;

Expand Down Expand Up @@ -240,8 +240,8 @@ onMounted(() => {
left: 0;
padding: 12px;
background: var(--MI_THEME-acrylicBg);
-webkit-backdrop-filter: var(--blur, blur(15px));
backdrop-filter: var(--blur, blur(15px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(15px));
backdrop-filter: var(--MI_UI-blur, blur(15px));
background-size: auto auto;
background-image: repeating-linear-gradient(135deg, transparent, transparent 5px, var(--MI_THEME-panel) 5px, var(--MI_THEME-panel) 10px);
border-radius: 0 0 6px 6px;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkFukidashi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ withDefaults(defineProps<{

<style module lang="scss">
.root {
--fukidashi-radius: var(--radius);
--fukidashi-radius: var(--MI_UI-radius);
--fukidashi-bg: var(--MI_THEME-panel);

position: relative;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function close() {
font-size: 90%;
background: var(--MI_THEME-infoBg);
color: var(--MI_THEME-infoFg);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
white-space: pre-wrap;

&.warn {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkInstanceStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ onMounted(() => {
min-width: 0;
position: relative;
background: var(--MI_THEME-panel);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
padding: 24px;
max-height: 300px;

Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkMediaAudio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ onDeactivated(() => {
container-type: inline-size;
position: relative;
border: .5px solid var(--MI_THEME-divider);
border-radius: var(--radius);
border-radius: var(--MI_UI-radius);
overflow: clip;

&:focus-visible {
Expand Down Expand Up @@ -454,7 +454,7 @@ onDeactivated(() => {

.controlButton {
padding: 6px;
border-radius: calc(var(--radius) / 2);
border-radius: calc(var(--MI_UI-radius) / 2);
font-size: 1.05rem;

&:hover {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkMediaImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ html[data-color-scheme=light] .visible {
position: absolute;
border-radius: 999px;
background-color: rgba(0, 0, 0, 0.3);
-webkit-backdrop-filter: var(--blur, blur(15px));
backdrop-filter: var(--blur, blur(15px));
-webkit-backdrop-filter: var(--MI_UI-blur, blur(15px));
backdrop-filter: var(--MI_UI-blur, blur(15px));
color: #fff;
font-size: 0.8em;
width: 28px;
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/components/MkMediaList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ defineExpose({
<style lang="scss">
.pswp__bg {
background: var(--MI_THEME-modalBg);
backdrop-filter: var(--modalBgFilter);
backdrop-filter: var(--MI_UI-modalBgFilter);
}

.pswp__alt-text-container {
Expand All @@ -338,8 +338,8 @@ defineExpose({
color: var(--MI_THEME-fg);
margin: 0 auto;
text-align: center;
padding: var(--margin);
border-radius: var(--radius);
padding: var(--MI_UI-margin);
border-radius: var(--MI_UI-radius);
max-height: 8em;
overflow-y: auto;
text-shadow: var(--MI_THEME-bg) 0 0 10px, var(--MI_THEME-bg) 0 0 3px, var(--MI_THEME-bg) 0 0 3px;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMediaVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ onDeactivated(() => {

.controlButton {
padding: 6px;
border-radius: calc(var(--radius) / 2);
border-radius: calc(var(--MI_UI-radius) / 2);
transition: background-color .2s ease-in-out;
font-size: 1.05rem;

Expand Down
Loading
Loading