Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
938c405b
Commit
938c405b
authored
Apr 08, 2026
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: move embedded content styles from global CSS to Tailwind
parent
124708f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
42 deletions
+24
-42
TrustedIframe.ts
web/src/components/MemoContent/TrustedIframe.ts
+5
-1
index.tsx
web/src/components/MemoContent/index.tsx
+3
-0
UserMemoMap.tsx
web/src/components/UserMemoMap/UserMemoMap.tsx
+15
-1
index.css
web/src/index.css
+1
-40
No files found.
web/src/components/MemoContent/TrustedIframe.ts
View file @
938c405b
import
{
createElement
}
from
"react"
;
import
{
createElement
}
from
"react"
;
import
{
cn
}
from
"@/lib/utils"
;
import
{
isTrustedIframeSrc
}
from
"./constants"
;
import
{
isTrustedIframeSrc
}
from
"./constants"
;
export
const
TrustedIframe
=
(
props
:
React
.
ComponentProps
<
"iframe"
>
)
=>
{
export
const
TrustedIframe
=
(
props
:
React
.
ComponentProps
<
"iframe"
>
)
=>
{
...
@@ -6,5 +7,8 @@ export const TrustedIframe = (props: React.ComponentProps<"iframe">) => {
...
@@ -6,5 +7,8 @@ export const TrustedIframe = (props: React.ComponentProps<"iframe">) => {
return
null
;
return
null
;
}
}
return
createElement
(
"iframe"
,
props
);
return
createElement
(
"iframe"
,
{
...
props
,
className
:
cn
(
"max-w-full rounded-lg border border-border"
,
props
.
className
),
});
};
};
web/src/components/MemoContent/index.tsx
View file @
938c405b
...
@@ -68,6 +68,9 @@ const MemoContent = (props: MemoContentProps) => {
...
@@ -68,6 +68,9 @@ const MemoContent = (props: MemoContentProps) => {
className=
{
cn
(
className=
{
cn
(
"relative w-full max-w-full wrap-break-word text-base leading-6"
,
"relative w-full max-w-full wrap-break-word text-base leading-6"
,
"[&>*:last-child]:mb-0"
,
"[&>*:last-child]:mb-0"
,
"[&_.katex-display]:max-w-full"
,
"[&_.katex-display]:overflow-x-auto"
,
"[&_.katex-display]:overflow-y-hidden"
,
showCompactMode
===
"ALL"
&&
"overflow-hidden"
,
showCompactMode
===
"ALL"
&&
"overflow-hidden"
,
contentClassName
,
contentClassName
,
)
}
)
}
...
...
web/src/components/UserMemoMap/UserMemoMap.tsx
View file @
938c405b
...
@@ -111,7 +111,21 @@ const UserMemoMap = ({ creator, className }: Props) => {
...
@@ -111,7 +111,21 @@ const UserMemoMap = ({ creator, className }: Props) => {
>
>
{
memosWithLocation
.
map
((
memo
)
=>
(
{
memosWithLocation
.
map
((
memo
)
=>
(
<
Marker
key=
{
memo
.
name
}
position=
{
[
memo
.
location
!
.
latitude
,
memo
.
location
!
.
longitude
]
}
icon=
{
defaultMarkerIcon
}
>
<
Marker
key=
{
memo
.
name
}
position=
{
[
memo
.
location
!
.
latitude
,
memo
.
location
!
.
longitude
]
}
icon=
{
defaultMarkerIcon
}
>
<
Popup
closeButton=
{
false
}
className=
"memo-map-popup w-64!"
>
<
Popup
closeButton=
{
false
}
className=
{
cn
(
"w-64!"
,
"[&_.leaflet-popup-content-wrapper]:rounded-lg"
,
"[&_.leaflet-popup-content-wrapper]:border"
,
"[&_.leaflet-popup-content-wrapper]:border-border"
,
"[&_.leaflet-popup-content-wrapper]:bg-background"
,
"[&_.leaflet-popup-content-wrapper]:shadow-lg"
,
"[&_.leaflet-popup-content]:m-1"
,
"[&_.leaflet-popup-content]:[font-size:inherit]"
,
"[&_.leaflet-popup-content]:[line-height:inherit]"
,
"[&_.leaflet-popup-tip]:bg-background"
,
)
}
>
<
div
className=
"flex flex-col gap-2.5 p-3"
>
<
div
className=
"flex flex-col gap-2.5 p-3"
>
<
div
className=
"flex items-start justify-between gap-3"
>
<
div
className=
"flex items-start justify-between gap-3"
>
<
div
className=
"space-y-1"
>
<
div
className=
"space-y-1"
>
...
...
web/src/index.css
View file @
938c405b
...
@@ -2,51 +2,12 @@
...
@@ -2,51 +2,12 @@
@import
"tw-animate-css"
;
@import
"tw-animate-css"
;
@import
"./themes/default.css"
;
@import
"./themes/default.css"
;
@theme
{
--default-transition-duration
:
150ms
;
}
@layer
base
{
@layer
base
{
*
{
*
{
@apply
border-border
outline-none
ring-0;
@apply
border-border
outline-none
ring-0;
}
}
body
{
body
{
@apply
bg-background
text-foreground;
@apply
bg-background
text-foreground;
}
}
/* ========================================
* Embedded Content
* ======================================== */
/* iframes from trusted embed providers */
iframe
{
max-width
:
100%
;
border-radius
:
0.5rem
;
border
:
1px
solid
var
(
--border
);
}
/* KaTeX math rendering */
.katex-display
{
overflow-x
:
auto
;
overflow-y
:
hidden
;
max-width
:
100%
;
}
/* Leaflet Popup Overrides */
.leaflet-popup-content-wrapper
{
border-radius
:
0.5rem
!important
;
border
:
1px
solid
var
(
--border
)
!important
;
background-color
:
var
(
--background
)
!important
;
box-shadow
:
var
(
--shadow-lg
)
!important
;
}
.leaflet-popup-content
{
margin
:
4px
!important
;
line-height
:
inherit
!important
;
font-size
:
inherit
!important
;
}
.leaflet-popup-tip
{
background-color
:
var
(
--background
)
!important
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment