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 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
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-margin);
margin-top: 4px;
border: 1px solid var(--MI_THEME-inputBorder);
border-radius: var(--radius);
border-radius: var(--MI-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-margin);
border: 1px solid var(--MI_THEME-divider);
border-radius: var(--radius);
border-radius: var(--MI-radius);
background-color: #000;

&:hover {
Expand Down
10 changes: 5 additions & 5 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-radius);
box-sizing: border-box;
}
}
Expand Down Expand Up @@ -356,7 +356,7 @@ const isDeleted = ref(false);
width: 58px;
height: 58px;
position: sticky !important;
top: calc(22px + var(--stickyTop, 0px));
top: calc(22px + var(--MI-stickyTop, 0px));
left: 0;
}

Expand All @@ -377,7 +377,7 @@ const isDeleted = ref(false);
width: 100%;
margin-top: 14px;
position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px);
bottom: calc(var(--MI-stickyBottom, 0px) + 14px);
}

.showLessLabel {
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-radius);
padding: 12px;
margin-top: 8px;
}
Expand Down Expand Up @@ -550,7 +550,7 @@ const isDeleted = ref(false);
margin: 0 10px 0 0;
width: 46px;
height: 46px;
top: calc(14px + var(--stickyTop, 0px));
top: calc(14px + var(--MI-stickyTop, 0px));
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/components/EmNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
width: 100%;
margin-top: 14px;
position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px);
bottom: calc(var(--MI-stickyBottom, 0px) + 14px);
}

.showLessLabel {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/components/EmNoteSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const showContent = ref(false);
height: 34px;
border-radius: 8px;
position: sticky !important;
top: calc(16px + var(--stickyTop, 0px));
top: calc(16px + var(--MI-stickyTop, 0px));
left: 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const collapsed = ref(isLong);
width: 100%;
margin-top: 14px;
position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px);
bottom: calc(var(--MI-stickyBottom, 0px) + 14px);
}

.showLessLabel {
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-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-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-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-radius: 12px;
--MI-marginFull: 14px;
--MI-marginHalf: 10px;

--margin: var(--marginFull);
--MI-margin: var(--MI-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-radius);
overflow: clip;
}

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

._gaps_m {
Expand All @@ -241,7 +241,7 @@ rt {
._gaps {
display: flex;
flex-direction: column;
gap: var(--margin);
gap: var(--MI-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-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-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-blur, blur(15px));
backdrop-filter: var(--MI-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-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-modalBgFilter', v ? 'blur(4px)' : 'none');
}, { immediate: true });

watch(defaultStore.reactiveState.useBlurEffect, v => {
if (v) {
document.documentElement.style.removeProperty('--blur');
document.documentElement.style.removeProperty('--MI-blur');
} else {
document.documentElement.style.setProperty('--blur', 'none');
document.documentElement.style.setProperty('--MI-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-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-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-blur, blur(12px));
backdrop-filter: var(--MI-blur, blur(12px));
display: flex;
justify-content: center;
align-items: center;
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ onUnmounted(() => {

.header {
position: sticky;
top: var(--stickyTop, 0px);
top: var(--MI-stickyTop, 0px);
left: 0;
color: var(--MI_THEME-panelHeaderFg);
background: var(--MI_THEME-panelHeaderBg);
Expand Down Expand Up @@ -201,7 +201,7 @@ onUnmounted(() => {
}

.content {
--stickyTop: 0px;
--MI-stickyTop: 0px;

&.omitted {
position: relative;
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-blur, blur(10px));
backdrop-filter: var(--MI-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-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-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-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-margin);
left: 0;
right: 0;
margin: auto;
box-sizing: border-box;
width: calc(100% - (var(--margin) * 2));
width: calc(100% - (var(--MI-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-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-radius);
background: var(--MI_THEME-panel);
padding: 1.5rem;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/components/MkFoldableSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ onMounted(() => {
position: relative;
z-index: 10;
position: sticky;
top: var(--stickyTop, 0px);
-webkit-backdrop-filter: var(--blur, blur(8px));
backdrop-filter: var(--blur, blur(20px));
top: var(--MI-stickyTop, 0px);
-webkit-backdrop-filter: var(--MI-blur, blur(8px));
backdrop-filter: var(--MI-blur, blur(20px));
}

.title {
Expand Down
10 changes: 5 additions & 5 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-blur, blur(15px));
backdrop-filter: var(--MI-blur, blur(15px));
border-radius: 6px;
transition: border-radius 0.3s;

Expand Down Expand Up @@ -236,12 +236,12 @@ onMounted(() => {
.footer {
position: sticky !important;
z-index: 1;
bottom: var(--stickyBottom, 0px);
bottom: var(--MI-stickyBottom, 0px);
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-blur, blur(15px));
backdrop-filter: var(--MI-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-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-radius);
white-space: pre-wrap;

&.warn {
Expand Down
Loading
Loading