Skip to content

Commit

Permalink
docs: fix UI bug on rules index and details pages (#16082)
Browse files Browse the repository at this point in the history
* fix: UI bug on rules index

* fix: UI bug in rule details page

* fix: UI bug on rule details page

* fix: update rules scss

* docs: fix UI bug on rule index and details page

* docs: revamp rules style

* docs: format scss file
  • Loading branch information
DeepshikaS committed Jul 6, 2022
1 parent f5db264 commit 09f6acb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/src/_includes/layouts/doc.html
Expand Up @@ -65,8 +65,10 @@ <h2 id="resources">Resources</h2>
<div class="docs-main__content">
<h1>{{ title }}</h1>
{% if rule_meta %}
{%set id = true if (rule_meta.docs.recommended or rule_meta.fixable or rule_meta.hasSuggestions) else false %}
<p>{{ rule_meta.docs.description | markdown | safe }}</p>
{{ ruleCategories({
index: id,
recommended: rule_meta.docs.recommended,
fixable: rule_meta.fixable,
hasSuggestions: rule_meta.hasSuggestions
Expand Down
33 changes: 30 additions & 3 deletions docs/src/assets/scss/components/rules.scss
@@ -1,14 +1,41 @@
.rule-categories {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 2rem 1rem;
gap: 0;
margin-bottom: 3rem;
background-color: var(--lightest-background-color);
border: 1px solid var(--divider-color);
border-radius: var(--border-radius);

.rule-category {
margin: 0;
padding: 0;
padding: 1rem;
background: none;
border: none;

@media screen and (min-width:768px){
&:not(:first-child)::after {
content: "";
display: block;
padding: 1px;
border-left: 1px solid var(--divider-color);
left: 0px;
}
}

@media screen and (min-width:768px) and (max-width:1023px), screen and (min-width:1440px){
&:not(:first-child)::after {
height: 70%;
position: absolute;
}
}

@media screen and (min-width:1024px) and (max-width:1439px){
&:nth-child(2)::after {
height: 70%;
position: absolute;
}
}
}

.rule-category__description {
Expand All @@ -19,6 +46,7 @@
.rule-category {
font-size: var(--step--1);
display: flex;
position: relative;
flex-wrap: wrap;
align-items: flex-start;
gap: 1rem;
Expand Down Expand Up @@ -133,7 +161,6 @@ a.rule__name {
}
}


/* related rules */

.related-rules__list {
Expand Down

0 comments on commit 09f6acb

Please sign in to comment.