Giter VIP home page Giter VIP logo

priority-plus's Introduction

Seal singing Kiss from a Rose

Hello there

I’m a software engineer living and working in East London. I currently work at Daphne. Prior to that I worked at Red Badger, where I built digital products and services for blue chips.

Currently reading
Release It!: Design and Deploy Production-Ready Software
Just watched
Poor Things
Now playing
Persona 3 Reload

You can find me on Mastodon here: @[email protected]

A few things I've written ✍️

priority-plus's People

Contributors

dependabot[bot] avatar jayfreestone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

priority-plus's Issues

Don't remove original classes and attributes

Hello,
finally find some time to start using and testing, and I have a huge problem using in the context of a CMS, or any dynamically generated content.

My menu is genereted dynamically too, with many informations on each entries, mostly via class names (but also data-attributes !). So on any "ul" and "li" there are class saying "this entry will point on an article/a category/an event/etc" or also "this entry is active, because it's part of the breadcrumb of the current page (like one of parent category)", etc.

Real life examples :

<ul class="menu-items" data-depth="1">
    <li class="menu-items__item menu-items__item_article menu-items__item_active">
        <a href="link to an article">

And all my themes will take all those classes and attributes in account to adjust styles, obviously.

But… this lib rewrite absolutely all top entries ! With own HTML and CSS classes, and only that, removing all the original ones (classes but also attributes). Sub-entries (when there is sub-menus, dropdown menus, etc) remain the sames, the rewriting is only for top entries.

The solution seems simple (I hope): the lib must never change the original code but only add its own classes, never removing which exist (any attributes).

Sticky items

There has been a request for 'sticky' items, and I'm trying to gauge if there is enough interest to warrant adding them.

Premise

The idea is that you would be able to 'stick' items to the end (possibly the beginning) of the visible navigation. These would not be part of the priority evaluation, and would remain no matter what.

Sticky items would provide a way of always including, for instance, 'Contact' in the navigation. Not only would it always be visible, but it would occupy its traditional space at the end of the nav.

Very rough demo:

sticky

If sticky items are added, it essentially allows for a 'squishy' middle part of the navigation:

sticky-sketch

Opposition

The biggest argument against the feature, other than increased complexity, is that if an item is 'high' priority, should it not just be promoted to higher up the list? The use-cases tend to be quite narrow, e.g. sticking 'Contact' to the far right. If the usefulness is so limited it might not be worth the extra size/complexity or dev time.

Incorrect path to css location in readme

Adding the menu now to a project and noticed the readme has:

// Doesn't have to be SASS, just ensure the CSS is included.
@import "../node_modules/priority-nav/css/priority-plus";

Rather than node_modules/priority-plus/css/priority-plus;

Allow to customize the click handler of the more button

Didn't see that in options list, so I make an enhancement request.

The default behavior for the More button is just to open/unfold an other menu containing hidden items. No change for that.

But some times, we want more complicated behavior, for example if we want to open a totally other menu than just the 2 or 3 hidden items, like a full sliding menu, or a fullscreen menu.

The simple way to allow that would be an option to pass a function which will overload the default handler. Like "buttonHandler" for ex, or "onToggleClick" to follow your current code.

The current "onToggleClick" could be rename as "onToggleClickDefault" and an option "onToggleClick" will wait a function, and trigger that if defined, else the default one.

Very simple, but one more customization possible! :)

Update package.json exports field to provide the css file

Hey Jay 👋

Yesterday I was playing around with this lib (amazing job btw!) and I noticed that Vite was complaining about the .css import that you state in the README file. Affter looking at the package.json exports field I saw that there's no CSS dedicated export.
Maybe in the past it used to work before defining the exports field but once this is present it means anything not explicitly listed inside is not exposed I guess.

Vite's complaining error:
image

Thanks so much! Let me know if you need any extra info 🙂

Feature request: Vertical orientation option

First, thanks for this lib, it's super useful and amazing that it takes into account accessibility concerns.

Second, I'm working with a navigation layout that changes its orientation from horizontal (mobile) to vertical (desktop) based on viewport width.

Quick devtools prototyping on your demo page makes it seem like I can achieve this with some Flexbox customization, thanks to your use of IntersectionObserver.

I'm curious if you have any thoughts on this approach and figured I'd raise it as a possible feature request since it seems like a cool option to have.

2022-07-11_02-36-50PM.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.