Skip to content

Commit

Permalink
CSS: mobile accordion icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
ControlledChaos committed Apr 13, 2021
1 parent ec614f3 commit 4ec6edc
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 5 deletions.
49 changes: 47 additions & 2 deletions assets/css/modules/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,34 @@
display: none;
}

/* Accordion responsive breakpoint */
// Accordion responsive breakpoint.
@media only screen and (max-width: 782px) {
.ds-tabs-nav {
display: none;
}

.ds-tabs-accordion-title {
display: block;

a {
&:before {
display: inline-block;
vertical-align: middle;
margin: 0 0.35em 0 0;
font-family: dashicons;
font-size: 1.5rem;
content: '\f140';
line-height: 1em;
}
}

&.ds-tabs-state-active {
a {
&:before {
transform: rotate(-90deg);
}
}
}
}
}

Expand All @@ -99,7 +119,7 @@
/* Accordion anchor */
.ds-tabs-accordion-title .ds-tabs-anchor {
display: block;
padding: 10px;
padding: 1em 0;
font-weight: bold;
font-weight: 600;
text-decoration: none;
Expand All @@ -125,3 +145,28 @@
display: block;
}
}

// RTL styles.
.rtl {

// Accordion responsive breakpoint.
@media only screen and (max-width: 782px) {

.ds-tabs-accordion-title {
a {
&:before {
margin: 0 0 0 0.35em;
}
}

&.ds-tabs-state-active {
a {
&:before {
transform: rotate(90deg);
margin: 0 0 0.35em 0;
}
}
}
}
}
}
27 changes: 25 additions & 2 deletions assets/css/widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,26 @@
display: none;
}

/* Accordion responsive breakpoint */
@media only screen and (max-width: 782px) {
.ds-tabs-nav {
display: none;
}
.ds-tabs-accordion-title {
display: block;
}
.ds-tabs-accordion-title a:before {
display: inline-block;
vertical-align: middle;
margin: 0 0.35em 0 0;
font-family: dashicons;
font-size: 1.5rem;
content: '\f140';
line-height: 1em;
}
.ds-tabs-accordion-title.ds-tabs-state-active a:before {
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
}
}

/* Tabs container */
Expand All @@ -96,7 +108,7 @@
/* Accordion anchor */
.ds-tabs-accordion-title .ds-tabs-anchor {
display: block;
padding: 10px;
padding: 1em 0;
font-weight: bold;
font-weight: 600;
text-decoration: none;
Expand All @@ -118,6 +130,17 @@
display: block;
}

@media only screen and (max-width: 782px) {
.rtl .ds-tabs-accordion-title a:before {
margin: 0 0 0 0.35em;
}
.rtl .ds-tabs-accordion-title.ds-tabs-state-active a:before {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
margin: 0 0 0.35em 0;
}
}

#dashboard-widgets #ds-widget h3,
#dashboard-widgets #ds-widget h4,
#dashboard-widgets #ds-widget p,
Expand Down
2 changes: 1 addition & 1 deletion assets/css/widgets.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ec6edc

Please sign in to comment.