Yohns PicoCSS Fork v2.2.0

I've merged some open pull requests from the original Pico repository, and then added a few more enhancements that I either needed for a project (timeline) or wanted to make the building process of websites easier (:user-valid "validation", using <label> within groups, .row & .row-fluid and the .col-* classes like Bootstrap, .align-* and more.) The demo docs here is the main enhanced that have been added to the Pico CSS 2.0.6 branch, for more docs, refer to the original Pico CSS docs.


(OPTIONAL) Some of the demos on this page do require Vanilla JavaScript Files to work the same as the preview here. I may get a build script going to compile the javascript plugins / components later. Let me know if this feature would help you.

If this fork has helped you, please Like this fork!

Hamburger Menu nav[role="navigation"]

Classless!

Use the default <nav> component in Pico CSS docs, but add the role="navigation" attribute to the <nav>.

Positioning

The default position puts your nav links and burger menu at the end of the line, but data-position="start" will put them at the start of the line.

Breakpoints

Use the data-breakpoint="**" to change when the burger menu appears. The different values are md, lg, xl and xxl. These are the same breakpoints the .row uses.

Hamburger Icon

Before the list of elements you want to be within the burger menu, add the following:

<input type="checkbox" id="YOUR-ID" />
<label for="YOUR-ID" style="font-size: calc(var(--pico-font-size) * 1.5);">&#x2261;</label>

Change YOUR-ID to whatever id you want to use, but ensure the id for the checkbox, is the same as the id for the label.

DO NOT put the input[type="checkbox"] within the <label> element, it will not work correctly if you do that.
Custom Hamburger Icon?

Replace the &#x2261; with your own icon, svg element, or image.

Collapsed List

Add role="list" attribute to the <ul> or <ol> element for the hamburger menu, and then add role="listitem" attribute to each <li> element.


Example Hamburger Menu

(resize width of screen if you don't see it)

Hamburger Menu Under Nav Example


Tabs section[role="region"]

Classless!

Information

  • I wanted this to work without javascript
  • I wanted to use the <details> and <summary> tags.

Grips

  1. I would have liked to use the role attribute values tablist, tab, and tabpanel but the w3 specs says we cant use roles on <details> and <summary> tags.
  2. <section> in theory has a default role attribute value of region, though not confirmed, or applied when we are using it for our CSS. So I went with the role="region" attribute to help with selecting the correct element with CSS, classless and no JavaScript!

Example Tabs with no JavaScript:

Tab 1

Content for Tab 1

Content for Tab 1

Tab 2

Just a random table

row 1 col 1 row 1 col 2 row 1 col 3
row 2 col 1 row 2 col 2 row 2 col 3
row 3 col 1 row 3 col 2 row 3 col 3
Tab 3
Tab 4

Content for Tab 4

Tab 5

Content for Tab 5


Tooltip

For multi-line tooltips, you can now add &#xa; where the line break should go within your tooltip area.

I also wanted to remove the dotted line on input fileds when they are contained within the tooltip element, so that is why this example has the input field with the tooltip on the <label> wrapper.

data-tooltip="this is &#xa; a test"

Floating Labels

Classless!

For floating labels to work, you need to add the role="form" attribute to a <section> tag, ensure you have a placeholder="example" attribute on your input or textarea tags, and that placeholder value needs to be the same value that is used within the label tag, which would go after your form element..



Validation

Classless!

Using form :user-valid and :user-invalid.

You can disable the validation by adding the attribute novalidate to the form tag.

Classless except for the file input button previews.

Check JS for FileValidator class


Group

Classless and no JavaScript!

I wanted to add the label tah to have an input group kind of thing going on.


Rows

Similar to Bootstrap 5.3.3, with the responsive .col-*COL#*, .col-*BREAKPOINT*-*COL#*, .offset-*COL#*, .offset-*BREAKPOINT*-*COL#*.

.row has a max width set to the viewport of your xl viewport (1300px by default)

.row-fluid max width is 100%.

col-3
col-6
col-3
col-3 offset-1
col-2
col-2
col-3
col-3
col-3
col-3
col-3
col-2
col-8
col-2
col-5
col-7
col-9
col-3

Columns with offsets defined by breakpoints

When defining multiple .col-*-* on the same element, the order your put the classes on the element matter.

col-2, col-md-4
col-4, offset-8, col-md-6, offset-md-6
col-5, offset-1, col-md-11
col-2, col-md-6
col-3, offset-9, col-md-6, offset-md-6
col-3 col-md-12 col-lg-6
col-3 col-md-12 col-lg-6
col-4 col-md-6 col-lg-3
col-6 offset-6 col-md-3 offset-md-9 col-lg-2 offset-lg-10

Alignment

You can add .align-start (default), .align-center or .align-end to your .row or .row-fluid element to align the containing elements to the top, middle, or bottom.

col-4
col-4

-md- Breakpoints

col-12, col-md-4
col-12, col-md-4
col-12, col-md-4


Popovers

Popovers will replace the notifications below.

Popover

Click/Tap everywhere else to close
Footer
Some Feedback Message With Close Button

Notificaton


Accordions

Accordion 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque urna diam, tincidunt nec porta sed, auctor id velit. Etiam venenatis nisl ut orci consequat, vitae tempus quam commodo. Nulla non mauris ipsum. Aliquam eu posuere orci. Nulla convallis lectus rutrum quam hendrerit, in facilisis elit sollicitudin. Mauris pulvinar pulvinar mi, dictum tristique elit auctor quis. Maecenas ac ipsum ultrices, porta turpis sit amet, congue turpis.

Accordion 2
  • Vestibulum id elit quis massa interdum sodales.
  • Nunc quis eros vel odio pretium tincidunt nec quis neque.
  • Quisque sed eros non eros ornare elementum.
  • Cras sed libero aliquet, porta dolor quis, dapibus ipsum.

Timeline


View Custom CSS
--pico-timeline-line-color: var(--pico-primary-background);
--pico-timeline-dot-background-color: var(--pico-primary-inverse);
--pico-timeline-dot-border-color: var(--pico-primary-background);
--pico-timeline-arrow-color: var(--pico-card-sectioning-background-color);

2017

Lorem ipsum dolor sit amet, quo ei simul congue exerci, ad nec admodum perfecto mnesarchum, vim ea mazim fierent detracto. Ea quis iuvaret expetendis his, te elit voluptua dignissim per, habeo iusto primis ea eam.

2016

Lorem ipsum dolor sit amet, quo ei simul congue exerci, ad nec admodum perfecto mnesarchum, vim ea mazim fierent detracto. Ea quis iuvaret expetendis his, te elit voluptua dignissim per, habeo iusto primis ea eam.

2015

Lorem ipsum dolor sit amet, quo ei simul congue exerci, ad nec admodum perfecto mnesarchum, vim ea mazim fierent detracto. Ea quis iuvaret expetendis his, te elit voluptua dignissim per, habeo iusto primis ea eam.

2012

Lorem ipsum dolor sit amet, quo ei simul congue exerci, ad nec admodum perfecto mnesarchum, vim ea mazim fierent detracto. Ea quis iuvaret expetendis his, te elit voluptua dignissim per, habeo iusto primis ea eam.

Confirm your action!

Cras sit amet maximus risus. Pellentesque sodales odio sit amet augue finibus pellentesque. Nullam finibus risus non semper euismod.