일부 팔레트는 다른 팔레트보다 색상 설정 옵션이 더 많다는 것을 발견했습니다.
예를 들어, Dracula 팔레트는 다른 팔레트보다 훨씬 더 많은 옵션을 제공합니다.
아래 게시물을 확인해 보았지만, 이것이 관련이 있는지 모르겠습니다:
I believe, due to the way the SCSS is compiled, custom dark/light definitions need to be added to color_definitions.scss within a theme and won’t work in other scss files.
[Screen Shot 2020-12-04 at 9.54.13 PM]
color_definitions.scss is high up in the cascade (before a lot of the default styles), so you don’t want to add the .modal.history-modal ins part there. Instead you can just add the color definition itself…
$dark-theme-ins: #acf2bd;
$light-theme-ins: #4da06d;
$ins: dark-light-choose(…
이것은 테마(Themes)와 관련이 있어 보이지만, 팔레트는 코드를 편집하여 색상(Color) 정의를 추가할 수 있는 옵션이 없습니다.
네, 테마는 개별 색상을 직접 오버라이드할 수 있습니다 — 색상 팔레트 관리자 영역에서는 이것이 불가능합니다.
As of v2.3.3 (released early September) you can now override our automatically-generated SASS color variables ($primary-low, $primary-medium, etc) in remote themes (you can not yet do this directly via the admin UI.)
To override one of these colors you need to add it to the color_scheme section of your theme’s about.json file. Once you’ve done that you can see the override listed within your color scheme in /admin/customize/colors.
"color_schemes": {
“My_colors”: {
"primary": "000000…
공유해 주셔서 감사합니다.
아직 일부 용어나 개념에 익숙하지 않은 사람에게 설명하자면, 제 서버에 SSH로 접속(이 용어가 맞는지요?)해서 해당 JSON 파일을 찾아서 수정을 해야 하고, 그러면 UI에도 그 변경 사항이 반영된다는 말씀이신가요?
그렇다면 기본 변수를 오버라이드하는 것뿐 아니라 새로운 변수를 추가하는 것도 가능한가요?
이렇게 하시면 다음 Discourse 업데이트 시 덮어써질 가능성이 높습니다… 따라서 기존 팔레트는 그대로 두시는 것이 좋습니다.
확장된 색상 오버라이드가 모두 포함된 새로운 팔레트를 생성하고 사용자가 해당 팔레트를 선택할 수 있게 하려면, 가장 간단한 방법은 테마를 생성하여 업로드하는 것입니다.
테마 자체에서는 about.json을 편집하여 색상 정의를 포함시키기만 하면 됩니다… 여기 예시가 있습니다:
"ssp-light": "assets/SourceSansPro-Light.ttf",
"ssp-light-italic": "assets/SourceSansPro-LightItalic.ttf",
"ssp-semibold": "assets/SourceSansPro-SemiBold.ttf",
"ssp-semibold-italic": "assets/SourceSansPro-SemiBoldItalic.ttf",
"ssp-bold": "assets/SourceSansPro-Bold.ttf",
"ssp-bold-italic": "assets/SourceSansPro-BoldItalic.ttf",
"ssp-black": "assets/SourceSansPro-Black.ttf",
"ssp-black-italic": "assets/SourceSansPro-BlackItalic.ttf",
"scp-regular": "assets/SourceCodePro-Regular.ttf"
},
"color_schemes": {
"Dracula": {
"primary": "f2f2f2",
"primary-high": "9da0b5",
"primary-medium": "727694",
"primary-low-mid": "727694",
"primary-low": "44475A",
"primary-very-low": "44475A",
"secondary": "282a36",
"secondary-high": "44475A",
"tertiary": "bd93f9",
테마가 사이트에 추가되면 포함된 색상 팔레트가 admin/customize/colors에 추가되며, 이를 사용자가 선택할 수 있도록 설정할 수 있습니다.
색상을 사용자 지정하는 또 다른 방법은 CSS로 직접 오버라이드하는 것입니다. 이는 특정 색상 팔레트 대신 특정 테마를 사용해야 합니다… 하지만 테마의 common 파일에서 다음과 같은 작업을 수행할 수 있습니다:
``css
:root {
--primary-low: red;
--secondary: #ff0000;
}
``
오버라이드할 수 있는 모든 사용 가능한 색상은 브라우저 인스펙터를 열고 상단의 HTML 요소를 클릭한 뒤 스크롤을 내려 확인하면 됩니다(지금은 변수가 매우 많습니다).
이 방법의 장점은 관리자 UI의 테마 편집기를 통해 이를 수행할 수 있다는 점입니다.
소화할 내용이 많지만, definitely 시간을 내서 읽고, 분석하고, 테스트해 볼 것입니다.
상세한 답변을 주셔서 정말 감사합니다. 내 노트에 저장해 두었습니다.