diff --git a/client/constants/Pattern.ts b/client/constants/Pattern.ts index 3629f7a..49158f4 100644 --- a/client/constants/Pattern.ts +++ b/client/constants/Pattern.ts @@ -43,6 +43,7 @@ enum Pattern { MegaMenu = 'Mega menu', Menu = 'Menu', Modal = 'Modal', + NestedDropdowns = 'Nested dropdowns', Notification = 'Notification', OverlayPlayButton = 'Overlay play button', Pagination = 'Pagination', diff --git a/client/pages/ExplorePage.tsx b/client/pages/ExplorePage.tsx index 2a56240..0d429b2 100644 --- a/client/pages/ExplorePage.tsx +++ b/client/pages/ExplorePage.tsx @@ -111,6 +111,7 @@ const ExplorePage = () => { + diff --git a/client/patterns/dropdown/Details.tsx b/client/patterns/dropdown/Details.tsx index 6533210..ebfb3a3 100644 --- a/client/patterns/dropdown/Details.tsx +++ b/client/patterns/dropdown/Details.tsx @@ -144,7 +144,7 @@ const Details: React.FC<{}> = () => { `} /> - + ); }; diff --git a/client/patterns/mega-menu/Details.tsx b/client/patterns/mega-menu/Details.tsx index fccf1b8..c07cfd4 100644 --- a/client/patterns/mega-menu/Details.tsx +++ b/client/patterns/mega-menu/Details.tsx @@ -145,7 +145,7 @@ const Details: React.FC<{}> = () => { /> - + ); }; diff --git a/client/patterns/menu/Details.tsx b/client/patterns/menu/Details.tsx index 8969de8..ebad8f7 100644 --- a/client/patterns/menu/Details.tsx +++ b/client/patterns/menu/Details.tsx @@ -199,7 +199,13 @@ const Details: React.FC<{}> = () => { /> ); diff --git a/client/patterns/nested-dropdowns/Cover.tsx b/client/patterns/nested-dropdowns/Cover.tsx new file mode 100644 index 0000000..33defae --- /dev/null +++ b/client/patterns/nested-dropdowns/Cover.tsx @@ -0,0 +1,81 @@ +/** + * A collection of popular layouts and patterns made with CSS (https://csslayout.io) + * (c) 2019 - 2020 Nguyen Huu Phuoc + */ + +import React from 'react'; + +import Circle from '../../placeholders/Circle'; +import Frame from '../../placeholders/Frame'; +import Line from '../../placeholders/Line'; + +const Cover: React.FC<{}> = () => { + return ( + +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ + ); +}; + +export default Cover; diff --git a/client/patterns/nested-dropdowns/Details.tsx b/client/patterns/nested-dropdowns/Details.tsx new file mode 100644 index 0000000..38eda66 --- /dev/null +++ b/client/patterns/nested-dropdowns/Details.tsx @@ -0,0 +1,155 @@ +/** + * A collection of popular layouts and patterns made with CSS (https://csslayout.io) + * (c) 2019 - 2020 Nguyen Huu Phuoc + */ + +import React from 'react'; +import { Helmet } from 'react-helmet'; + +import './nested-dropdowns.css'; + +import RelatedPatterns from '../../components/RelatedPatterns'; +import Pattern from '../../constants/Pattern'; +import DetailsLayout from '../../layouts/DetailsLayout'; +import BrowserFrame from '../../placeholders/BrowserFrame'; + +const Details: React.FC<{}> = () => { + return ( + + + + + +
+
+ Hover on the Patterns → Navigation to see the sub dropdowns. +
+ +
    +
  • Home
  • +
  • +
    Patterns
    +
      +
    • Layout
    • +
    • Input
    • +
    • +
      Navigation
      +
        +
      • Breadcrumb
      • +
      • Dropdown
      • +
      • Menu
      • +
      • Nested dropdown
      • +
      +
    • +
    • Display
    • +
    • Feedback
    • +
    +
  • +
  • Products
  • +
  • About
  • +
+
+ )} + source={` + + +
    +
  • Home
  • +
  • +
    Patterns
    + +
      +
    • Layout
    • +
    • Input
    • +
    • +
      Navigation
      + +
        +
      • Breadcrumb
      • +
      • Dropdown
      • +
      • Menu
      • +
      • Nested dropdown
      • +
      +
    • +
    • Display
    • +
    • Feedback
    • +
    +
  • +
  • Products
  • +
  • About
  • +
+`} + /> + + + +
+ ); +}; + +export default Details; diff --git a/client/patterns/nested-dropdowns/nested-dropdowns.css b/client/patterns/nested-dropdowns/nested-dropdowns.css new file mode 100644 index 0000000..4f69821 --- /dev/null +++ b/client/patterns/nested-dropdowns/nested-dropdowns.css @@ -0,0 +1,43 @@ +/** + * A collection of popular layouts and patterns made with CSS (https://csslayout.io) + * (c) 2019 - 2020 Nguyen Huu Phuoc + */ + +.p-nested-dropdowns { + border: 1px solid rgba(0, 0, 0, 0.3); + display: flex; + list-style-type: none; + margin: 0; + padding: 0; +} + +.p-nested-dropdowns li { + padding: 8px; + position: relative; +} + +.p-nested-dropdowns ul { + border: 1px solid rgba(0, 0, 0, 0.3); + display: none; + left: 0; + list-style-type: none; + margin: 0; + padding: 0; + position: absolute; + top: 100%; + width: 200px; +} + +.p-nested-dropdowns ul ul { + left: 100%; + position: absolute; + top: 0; +} + +.p-nested-dropdowns li:hover { + background-color: rgba(0, 0, 0, 0.1); +} + +.p-nested-dropdowns li:hover > ul { + display: block; +} diff --git a/public/sitemap.xml b/public/sitemap.xml index 9d7b0bd..fd99165 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -39,6 +39,7 @@ https://csslayout.io/patterns/mega-menu https://csslayout.io/patterns/menu https://csslayout.io/patterns/modal + https://csslayout.io/patterns/nested-dropdowns https://csslayout.io/patterns/notification https://csslayout.io/patterns/overlay-play-button https://csslayout.io/patterns/pagination