Tagged “codepen”
Simple input[type=range] styling, by Ana Tudor
Ana demonstrates how to achieve a range slider effect accessibly, using web standards and without needing to reach for libraries.
As Ana’s tweet explains, this offers a number of features and benefits:
- can drag thumb with JS disabled
- receives focus
- keyboard navigation
- clicking track moves thumb there and changes slider value
- seen as slider in Accessibility panel
- no library needed, so less code in total
Create an Automatically Responsive Flexbox Gallery (on egghead.io)
Here’s a lovely intrinsically responsive (no media queries) photo gallery solution from Stephanie Eckles. It can accommodate differently sized images and achieves its layout by a combination of flexbox features (flex-wrap
, flex-basis
) and by applying object-fit: cover
to photos to make them fully cover their parent list items.
My Codepen Cheatsheet
I’m finding Codepen to be more and more valuable not only for testing out new code and ideas, but also – when working on large applications – as a time-saving rapid prototyping environment which sidesteps the overhead of back-end set-up. Here are some tips which I’ve found useful, for future reference.
Control the Editor View layout
Append /left/
, /right/
, or /top/
to the URL to set the editor layout.
Append ?editors=1111
(change numbers as appropriate) to the URL to set which panels are maximised (in order of HTML, CSS, JavaScript, and console).
For example:
https://codepen.io/fuzzylogicx/pen/BEEYQL/left/?editors=1100
References
- https://blog.codepen.io/documentation/url-extensions/
- Adding external resources to a pen
- ES Modules on codepen
- https://www.hongkiat.com/blog/codepen-tips-beginners/
See all tags.