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

Add catcol as colour name to use the category colour for the icon #8

Merged
merged 4 commits into from Sep 28, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions .project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>discourse-category-icons</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
7 changes: 7 additions & 0 deletions .settings/.jsdtscope
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="src" path=""/>
<classpathentry kind="output" path=""/>
</classpath>
1 change: 1 addition & 0 deletions .settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.JRE_CONTAINER
1 change: 1 addition & 0 deletions .settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
Global
3 changes: 2 additions & 1 deletion javascripts/discourse/initializers/category-icons.js
Expand Up @@ -107,7 +107,8 @@ export default {
/// Add custom category icon from theme settings
let iconItem = getIconItem(category.slug);
if (iconItem) {
let itemColor = iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
let itemColor = iconItem[2] == 'catcol' ? `style="color: #${color}"` : iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
/// let itemColor = iconItem[2] ? `style="color: ${iconItem[2]}"` : "";
rogercreagh marked this conversation as resolved.
Show resolved Hide resolved
let itemIcon = iconItem[1] != "" ? iconHTML(iconItem[1]) : "";
html += `<span ${itemColor} class="category-badge-icon">${itemIcon}</span>`;
}
Expand Down
2 changes: 1 addition & 1 deletion settings.yml
@@ -1,7 +1,7 @@
category_icon_list:
default: 'help,question-circle,#CC0000,partial|'
type: 'list'
description: 'Enter comma-delimited configuration for categories, in the format "slug,icon,colour,match". If match is "partial" then the slug need only partially match the category-slug, otherwise an exact match is required'
description: 'Enter comma-delimited configuration for categories, in the format "slug,icon,colour,match". Colour in format #123456 or "catcol" to use the default colour for the category (same as the Badge colour). If match is "partial" then the slug need only partially match the category-slug, otherwise an exact match is required'
svg_icons:
default: 'question-circle'
type: 'list'
Expand Down