margin: 1em 0;
}
-.rule-desc h2,
.markdown h2 {
font-size: var(--bigFontSize);
font-weight: 400;
}
-.rule-desc h3,
.markdown h3,
-.rule-desc h4,
.markdown h4,
-.rule-desc h5,
.markdown h5,
-.rule-desc h6,
.markdown h6 {
font-size: var(--baseFontSize);
font-weight: 600;
}
+.rule-desc h2 {
+ font-size: 20px;
+ font-weight: 400;
+ border-bottom: 1px solid #e6e6e6;
+}
+
+.rule-desc h3 {
+ font-size: 18px;
+ font-weight: 500;
+}
+.rule-desc h4 {
+ font-size: 14px;
+ font-weight: 700;
+}
+
+.rule-desc h5,
+.rule-desc h6 {
+ font-size: var(--baseFontSize);
+ font-weight: 600;
+}
+
.rule-desc pre,
.markdown pre,
.rule-desc code,
if (section.key === RuleDescriptionSections.DEFAULT) {
return (
<section
- className="coding-rules-detail-description rule-desc markdown"
+ className="coding-rules-detail-description markdown"
key={section.key}
/* eslint-disable-next-line react/no-danger */
dangerouslySetInnerHTML={{ __html: sanitizeString(section.content) }}
: translate('coding_rules.description_section.title', section.key);
return (
- <section className="coding-rules-detail-description rule-desc markdown" key={section.key}>
+ <section className="coding-rules-detail-description rule-desc" key={section.key}>
<h2>{title}</h2>
<div
/* eslint-disable-next-line react/no-danger */
key: TabKeys;
label: React.ReactNode;
content: string;
+ isDefault: boolean;
}
export enum TabKeys {
[RuleDescriptionSections.DEFAULT, RuleDescriptionSections.ROOT_CAUSE].includes(
section.key
)
- )?.content
+ )?.content,
+ isDefault:
+ ruleDetails.descriptionSections?.find(
+ section => section.key === RuleDescriptionSections.DEFAULT
+ ) !== undefined
},
{
key: TabKeys.HowToFixIt,
label: translate('issue.tabs', TabKeys.HowToFixIt),
content: ruleDetails.descriptionSections?.find(
section => section.key === RuleDescriptionSections.HOW_TO_FIX
- )?.content
+ )?.content,
+ isDefault: false
},
{
key: TabKeys.Resources,
label: translate('issue.tabs', TabKeys.Resources),
content: ruleDetails.descriptionSections?.find(
section => section.key === RuleDescriptionSections.RESOURCES
- )?.content
+ )?.content,
+ isDefault: false
}
].filter(tab => tab.content !== undefined) as Array<Tab>;
{tabs.slice(1).map(tab => (
<div
key={tab.key}
- className={classNames('markdown big-padded', {
- hidden: currentTabKey !== tab.key
+ className={classNames('big-padded', {
+ hidden: currentTabKey !== tab.key,
+ markdown: tab.isDefault,
+ 'rule-desc': !tab.isDefault
})}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: sanitizeString(tab.content) }}