mirror of
https://github.com/picocss/pico.git
synced 2025-04-20 08:45:06 -04:00
updated accordian and dropdown to not overlap the arrow, provide enough space for the arrow, and keep the arrow at the top when theres multi-lines for the sumary text.
Reverted back the container padding.
This commit is contained in:
parent
e8bfb763ff
commit
869da59717
4 changed files with 37 additions and 23 deletions
|
@ -542,7 +542,7 @@
|
||||||
<ol id="nav-example" role="list">
|
<ol id="nav-example" role="list">
|
||||||
<li role="listitem"><a href="javascript:void(0);">Home</a></li>
|
<li role="listitem"><a href="javascript:void(0);">Home</a></li>
|
||||||
<li role="listitem">
|
<li role="listitem">
|
||||||
<details class="dropdown hide-arrow">
|
<details class="dropdown">
|
||||||
<summary class="secondary" role="button">About</summary>
|
<summary class="secondary" role="button">About</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="javascript:void(0);">What’s new in v2?</a></li>
|
<li><a href="javascript:void(0);">What’s new in v2?</a></li>
|
||||||
|
@ -574,7 +574,7 @@
|
||||||
<ol id="nav-example2" role="list">
|
<ol id="nav-example2" role="list">
|
||||||
<li role="listitem"><a href="javascript:void(0);">Home</a></li>
|
<li role="listitem"><a href="javascript:void(0);">Home</a></li>
|
||||||
<li role="listitem">
|
<li role="listitem">
|
||||||
<details class="dropdown hide-arrow">
|
<details class="dropdown">
|
||||||
<summary>About 2</summary>
|
<summary>About 2</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="javascript:void(0);">What’s new in v2?</a></li>
|
<li><a href="javascript:void(0);">What’s new in v2?</a></li>
|
||||||
|
@ -600,11 +600,20 @@
|
||||||
<li role="listitem"><a href="javascript:void(0);">Pico CSS</a></li>
|
<li role="listitem"><a href="javascript:void(0);">Pico CSS</a></li>
|
||||||
<li role="listitem"><a href="javascript:void(0);">Example</a></li>
|
<li role="listitem"><a href="javascript:void(0);">Example</a></li>
|
||||||
<li role="listitem">
|
<li role="listitem">
|
||||||
<details class="dropdown hide-arrow">
|
<details class="dropdown">
|
||||||
<summary>Submenu</summary>
|
<summary>Submenu</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="javascript:void(0);">Another Link</a></li>
|
<li><a href="javascript:void(0);">Another Link</a></li>
|
||||||
<li><a href="javascript:void(0);">And Again</a></li>
|
<li><a href="javascript:void(0);">And Again</a></li>
|
||||||
|
<li>
|
||||||
|
<details class="dropdown">
|
||||||
|
<summary>Another Submenu</summary>
|
||||||
|
<ul>
|
||||||
|
<li><a href="javascript:void(0);">Another Link</a></li>
|
||||||
|
<li><a href="javascript:void(0);">And Again</a></li>
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
#{$parent-selector} details {
|
#{$parent-selector} details {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
margin-block-end: var(#{$css-var-prefix}spacing);
|
||||||
|
|
||||||
@if $enable-classes {
|
@if $enable-classes {
|
||||||
&.hide-arrow > summary::after {
|
&.hide-arrow > summary::after {
|
||||||
|
@ -16,9 +16,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not(.hide-arrow) > summary {
|
||||||
|
padding-inline-end: calc(var(#{$css-var-prefix}nav-link-spacing-horizontal) * 3.25);
|
||||||
|
}
|
||||||
|
|
||||||
summary {
|
summary {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-inline-end: var(#{$css-var-prefix}block-spacing-horizontal);
|
//padding-inline-end: var(#{$css-var-prefix}block-spacing-horizontal);
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -91,13 +95,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//!
|
|
||||||
//!
|
|
||||||
//!
|
|
||||||
// Open
|
// Open
|
||||||
&[open] {
|
&[open] {
|
||||||
> summary {
|
> summary {
|
||||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
margin-block-end: var(#{$css-var-prefix}spacing);
|
||||||
|
|
||||||
&:not([role]) {
|
&:not([role]) {
|
||||||
&:not(:focus) {
|
&:not(:focus) {
|
||||||
|
|
|
@ -138,7 +138,7 @@
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
min-width: fit-content;
|
min-width: fit-content;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: var(#{$css-var-prefix}outline-width);
|
margin-block-start: var(#{$css-var-prefix}outline-width);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: var(#{$css-var-prefix}border-width)
|
border: var(#{$css-var-prefix}border-width)
|
||||||
solid
|
solid
|
||||||
|
@ -163,22 +163,22 @@
|
||||||
|
|
||||||
li {
|
li {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 0;
|
margin-block-end: 0;
|
||||||
padding: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5)
|
padding: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5)
|
||||||
var(#{$css-var-prefix}form-element-spacing-horizontal);
|
var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
||||||
&:first-of-type {
|
&:first-of-type {
|
||||||
margin-top: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5);
|
margin-block-start: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
margin-bottom: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5);
|
margin-block-end: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
details {
|
details {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 0;
|
margin-block-end: 0;
|
||||||
> summary {
|
> summary {
|
||||||
line-height: var(#{$css-var-prefix}line-height);
|
line-height: var(#{$css-var-prefix}line-height);
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@
|
||||||
// Button opened
|
// Button opened
|
||||||
// inside container type accordion
|
// inside container type accordion
|
||||||
// ––––––––––––––––––––
|
// ––––––––––––––––––––
|
||||||
margin-bottom: 0;
|
margin-block-end: 0;
|
||||||
|
|
||||||
// Close for dropdown
|
// Close for dropdown
|
||||||
// inside container type accordion
|
// inside container type accordion
|
||||||
|
@ -263,7 +263,7 @@
|
||||||
display: inline;
|
display: inline;
|
||||||
margin: calc(var(#{$css-var-prefix}nav-element-spacing-vertical) * -1) 0;
|
margin: calc(var(#{$css-var-prefix}nav-element-spacing-vertical) * -1) 0;
|
||||||
// Override height
|
// Override height
|
||||||
margin-bottom: 0;
|
margin-block-end: 0;
|
||||||
|
|
||||||
&.hide-arrow {
|
&.hide-arrow {
|
||||||
> summary::after {
|
> summary::after {
|
||||||
|
@ -294,11 +294,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not(.hide-arrow) > summary {
|
||||||
|
padding-inline-end: calc(var(#{$css-var-prefix}nav-link-spacing-horizontal) * 3.25);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
// ––––––––––––––––––––
|
// ––––––––––––––––––––
|
||||||
#{$parent-selector} label > details.dropdown {
|
#{$parent-selector} label > details.dropdown {
|
||||||
margin-top: calc(var(#{$css-var-prefix}spacing) * 0.25);
|
margin-block-start: calc(var(#{$css-var-prefix}spacing) * 0.25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,16 +14,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#{$parent-selector} .container {
|
#{$parent-selector} .container {
|
||||||
//$first-breakpoint: true;
|
$first-breakpoint: true;
|
||||||
@each $key, $values in $breakpoints {
|
@each $key, $values in $breakpoints {
|
||||||
@if $values {
|
@if $values {
|
||||||
@media (min-width: map.get($values, "breakpoint")) {
|
@media (min-width: map.get($values, "breakpoint")) {
|
||||||
max-width: map.get($values, "viewport");
|
max-width: map.get($values, "viewport");
|
||||||
//@if $first-breakpoint {
|
@if $first-breakpoint {
|
||||||
// $first-breakpoint: false;
|
$first-breakpoint: false;
|
||||||
// padding-right: 0;
|
padding-inline: 0;
|
||||||
// padding-left: 0;
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue