murmurcreative / module-drawer Goto Github PK
View Code? Open in Web Editor NEWOpen and close things, but in a nice way.
Open and close things, but in a nice way.
This is a simple accessibility thing that we should try and automate. Maybe something like:
If a controller item is available to the drawer, either:
a) Get the drawer ID, and set that as the aria-controls
value
b) Generate a unique ID (if not set) and set that as the aria-controls
value
If the drawer can't find a controller, then don't bother--no need to try and get fancy about it.
It should :(
The current release build process generates a compiled file that works fine, but if imported via webpack (or mix) causes a warning like this to be thrown on build:
WARNING in ./node_modules/@murmurcreative/drawer/dist/index.js 1:292-296
Critical dependency: the request of a dependency is an expression
@ ./resources/assets/scripts/modules/primary-nav.js
@ ./resources/assets/scripts/app.js
@ multi ./resources/assets/scripts/app.js ./resources/assets/styles/app.css ./resources/assets/styles/editor.css
This error seems to be a result of how Parcel compiles things down to a single file, using it's own require
functionality, which webpack then complains about.
So far as I can tell this has no negative effects (beyond throwing this error) but the intent for this package is for it to be simple, easy, and understandable, and arcane errors are counter to those goals.
Potential solutions:
Since I'd like to generate a single artifact people can import and then go, I'm leaning toward option 1, much as I like Parcel.
We've run into consistent issue with IE (and occasionally Edge) w/r/t to their lack of support for particular aspects of the libraries and technologies used in this module. It's a pain in the ass and I hate it, and we really get very little use out of the things that make web components unique (i.e. the Shadow DOM) and in fact end up fighting against them a lot. It's time for a v2 that removes the web component dependency and Just Works in at least some subset of older browsers.
The exact structure of this new plugin is under discussion and consideration, but I'm leaning strongly toward something similar to the original site-navigation package that inspired this one: It expects a particular HTML layout, and then hooks into that to add some events, functionality, etc. This is simpler and uses a pattern long familiar to web developers, and also makes it easier to style--no more dicking around with the Shadow DOM.
The intent is also to make all aspects of this package more module: The original design was an implementation of Inclusive Components' Collapsible Sections. While I'd like to remain heavily influenced by that design and it's accessibility goals, I also want to make the bare module-drawer less opinionated and more flexible in the view of a Linux program: All functionality should be focused on doing one thing, and doing it well. For more complex things, compose this package with others.
I'd like to have some code snippets that are more or less copy-and-go for common use cases (i.e. navigation).
Ultimately it might be nice to have some small associated packages the collect that functionality is a pre-packaged way w/ Drawer as a dependency.
Not adding this to the 2.0 milestone because the package is simple enough that I feel okay about no tests (and I have no experience writing JS testing, so it may be a long road), but tests should definitely be implemented to make future development/enhancement quicker and safer.
Short version: IE doesn't do a redraw when data-
attributes change.
Long version: https://stackoverflow.com/questions/31588262/css-styling-via-data-attribute-is-not-working-properly-on-ie
Apparently you can get around this by using get/setAttribute()
, which does(??) trigger a redraw. Hopefully I can just slip in a shim that uses that instead and we'll be golden.
This should roughly duplicate the same functionality from v1.
Good practice and should help make future dev safer.
module-drawer/docs/_site/docs.html
Lines 413 to 418 in 27d5ebd
TODO
comment in 27d5ebd. It's been assigned to @alwaysblank because they committed the code.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.