mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
tabs: fix style for indented code blocks #550
This commit is contained in:
parent
822a913e83
commit
25e39cfe34
3 changed files with 9 additions and 10 deletions
|
@ -122,10 +122,8 @@ While pressing a tab of group A switches all tab views of group A in sync (if th
|
||||||
<Hello>World</Hello>
|
<Hello>World</Hello>
|
||||||
```
|
```
|
||||||
{{%/* /tab */%}}
|
{{%/* /tab */%}}
|
||||||
{{%/* tab title="properties" */%}}
|
{{%/* tab title="text" */%}}
|
||||||
```properties
|
Hello World
|
||||||
Hello = World
|
|
||||||
```
|
|
||||||
{{%/* /tab */%}}
|
{{%/* /tab */%}}
|
||||||
{{</* /tabs */>}}
|
{{</* /tabs */>}}
|
||||||
````
|
````
|
||||||
|
@ -178,10 +176,10 @@ Hello = World
|
||||||
<Hello>World</Hello>
|
<Hello>World</Hello>
|
||||||
```
|
```
|
||||||
{{% /tab %}}
|
{{% /tab %}}
|
||||||
{{% tab title="properties" %}}
|
{{% tab title="text" %}}
|
||||||
```ini
|
|
||||||
Hello = World
|
Hello World
|
||||||
```
|
|
||||||
{{% /tab %}}
|
{{% /tab %}}
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
|
|
|
@ -1955,6 +1955,7 @@ html[dir="rtl"] #sidebar ul.collapsible-menu > li > label > i.fa-chevron-right {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
/* remove border from a code block if single */
|
/* remove border from a code block if single */
|
||||||
#body .tab-content-text > div.highlight:only-child > pre{
|
#body .tab-content-text > div.highlight:only-child > pre,
|
||||||
|
#body .tab-content-text > pre.pre-code:only-child{
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ function adjustContentWidth(){
|
||||||
function fixCodeTabs(){
|
function fixCodeTabs(){
|
||||||
/* if only a single code block is contained in the tab and no style was selected, treat it like style=code */
|
/* if only a single code block is contained in the tab and no style was selected, treat it like style=code */
|
||||||
var codeTabPanels = Array.from( document.querySelectorAll( '.tab-content.tab-panel-style.initial' ) ).filter( function( tabPanel ){
|
var codeTabPanels = Array.from( document.querySelectorAll( '.tab-content.tab-panel-style.initial' ) ).filter( function( tabPanel ){
|
||||||
return tabPanel.querySelector( '.tab-content-text > div.highlight:only-child');
|
return tabPanel.querySelector( '.tab-content-text > div.highlight:only-child, .tab-content-text > pre.pre-code:only-child');
|
||||||
});
|
});
|
||||||
|
|
||||||
codeTabPanels.forEach( function( tabPanel ){
|
codeTabPanels.forEach( function( tabPanel ){
|
||||||
|
|
Loading…
Reference in a new issue