2024年5月8日 星期三

multipart Email 的 Content-Disposition 差異

如果我今天要寄一封 E-Mail,內文要有圖片,那整封信的內容可能如下:

Subject: This is a test mail!
From: test@example.com
Content-Type: multipart/mixed; boundary="qwertyuio"

--qwertyuio
Content-Type: text/html; name="example.html"

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<title>Example</title>
	</head>
	<body>
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
		<img alt="" src="cid:28ce9652-4476-4e3c-8e9a-5d1bbae4cd05" />
	</body>
</html>

--qwertyuio
Content-Type: image/jpeg; name="example.jpg"
Content-Disposition: attachment; filename="example.jpg"
Content-ID: 28ce9652-4476-4e3c-8e9a-5d1bbae4cd05

<image content>

--qwertyuio--

2024年5月3日 星期五

SASS/SCSS處理 CSS 變數的問題

這是我使用他人套件時遇到的坑。

在使用 SASS / SCSS 時,遇到如下的 code

$red: #DB055E;

:root {
	--red: $red
}

.danger {
	color: var(--red)
}

我預期他應該會生成

:root {
	--red: #DB055E;
}
.danger {
	color: var(--red);
}

但實際上卻是生成

:root {
	--red: $red;
}
.danger {
	color: var(--red);
}