Hey, I have a small open source project with a static web page and I opened an issue that I think could be a good first PR for someone. It's adding a short info block to the page. The text is already written, so the work is the HTML/CSS: making it fit the existing style (fonts, colors) and look good on a phone at 390px.
I wanted a subtle circuit-board background for web projects without relying on <canvas> or heavy libraries, so I put together this small drop-in script and stylesheet.
On page load, it generates a random layout of non-crossing traces with occasional electron pulses flowing through them, plus a live loading-state toggle (CircuitBackground.setLoad(5)) to speed up activity when needed. It also adapts automatically to light/dark themes, supports accent tinting with --circuit-color, and respects prefers-reduced-motion.
Somewhere in the beginning of this year I decided to relearn modern CSS. It’s a hobby of mine to make websites. I have been using bootstrap since version 3 I think. So, I find a lot of changes has taken place.
I took time to relearn as I am not a fast learner anymore. So far I had a very firm understanding of grid and flexbox. Another new favourite function is clamp. Recently discovered oklch color format (coming from something like web-safe colors) it’s overwhelming but I grasped the basic of it.
So far I have ported my personal blog to my own CSS and there is still a lot of work to do. I have yet to do light/dark theme on it.
Now, I want to share a side project that I build earlier just for fun in bootstrap but now rewrote the CSS, JS I did the earlier work but as I am not well versed with JS so I use Gemini to achieve what I wanted. I use flex and grid a lot and I think this side project is a good way to do grid. Also used clamp for font-size and even height/width too and gap.
I had occasion to utilise an .svg file as a comic strip viewer, with the panels being a vertical strip to scroll through, and I wanted buttons for: a) restarting the UI-less slideshow, and b) going to a grid overview of all the panels.
I originally just made nine copies of the same two buttons, positioning each at the "same" point at the bottom of each panel, but then I saw that animation-timeline: scroll() recently landed in all browsers so decided to give that a go.
No critiques of the comic itself please, it's not mine:
I've been building VinUI, an open-source component library. The main idea is that switching the whole look of a site should only mean swapping CSS variables.
It has eight styles: Precision, Tactile, Clay, Tonal, Editorial, Terminal, Paper and Bento. Every component keeps the same HTML and class names across all of them. Each style is just a set of custom properties, and accent colour, radius, font and density are variables on top. So one button can go from flat and minimal to soft clay-like depth to a monospace terminal look without changing a single tag.
Other CSS details:
Ships its own small CSS files, so it can sit alongside Tailwind or your own styles
Charts are plain SVG
Each component checked against WCAG 2.2 AA contrast in all eight styles, in light and dark
I have just come across the light-dark() function and experimented with it. Now I realise color choice became limited, especially pairing light-dark part.
Does using light-dark scheme limit colour choice? I would love to know if there is any better scheme generator tool out there to experiment. I currently use colorffy.
We're building an AI study tutor, and this week we gave its notebook a phone layout. These are the rules that mattered most. The CSS and a small script are in a Gist.
Text fields at 16px or more. iOS Safari zooms the page when you tap into anything smaller.
Touch targets around 44px.
viewport-fit=cover, then pad bottom bars with env(safe-area-inset-bottom) so the home indicator doesn't sit on top of your buttons.
Nothing important only on hover. Phones have no hover, so anything that appears on hover has to be always visible there.
A bar that follows the keyboard. The keyboard covers the page instead of shrinking it, so a small script reads visualViewport and keeps a --kb CSS variable equal to the keyboard height.
Menus as bottom sheets, not popovers.
Cut what a thumb can't do. We dropped drag-to-reorder, multi-select and the resizable split on phones and added Move up / Move down instead. Our block menu opens from a button rather than a long-press, because long-press fights text selection on iOS.
I built an interactive demo where you can explore different animated mobile menu styles in one place. You can switch between them right in the interface and see how they work.
There are 11 styles in the full collection, seven of which are available to try in the demo.
I also offer the full package with the HTML, CSS, and JavaScript source files. The code doesn't rely on any specific framework and can be adapted for personal or client projects, although some extra work may be needed to integrate it into an existing website.
I think it could be useful both as code to adapt for your own projects and as a way to show clients different mobile navigation options.
Would a tool like this be useful in your workflow, either for showing options to clients or as a starting point for development? Why or why not?
It's been a year since I started learning HTML, CSS, JavaScript, and web design and development in general. I build websites for my friends' small businesses, as well as personal projects.
Here's the thing: every time I want to center something, I go:
div {
display: flex;
justify-content: center;
align-items: center;
}
I feel like I'm relying on Flexbox way too much. What other CSS layout techniques should I be using?
I want the "Currently selected: First_select" to remain there as I scroll through the nav bar.
I've tried to use a div, but when I make it "position:fixed" it vaporizes. The only way I can think of it going under the nav bar is that I have it set to height 100%.
How I currently have it set up in the screenshot above is that I have it as a header under <nav>, but it scrolls with the nav bar which I do not want. With the div it looks like this:
Which breaks the scroll on the nav bar and breaks the text to the right.
<div style="margin-left:242px;padding:1px 16px;height:1000px;"> <article> Lorem ipsum dolor sit amet consectetur adipisicing elit. Enim sint vel impedit minima sapiente, tempore ut minus obcaecati mollitia modi quod perferendis. Perspiciatis maxime natus amet accusantium sunt labore praesentium. </article>
<div style="margin-left:242px;padding:1px 16px;height:1000px;"> <article> Lorem ipsum dolor sit amet consectetur adipisicing elit. Enim sint vel impedit minima sapiente, tempore ut minus obcaecati mollitia modi quod perferendis. Perspiciatis maxime natus amet accusantium sunt labore praesentium. </article>
I'm currently learning CSS through Kevin Powell's CSS Demystified course, and one thing the lessons strongly encourage is using logical properties instead of traditional physical properties.
For example, using margin-inline instead of margin-left and margin-right, or padding-block instead of padding-top and padding-bottom.
I understand the reasoning behind logical properties, especially when it comes to supporting different writing modes and languages. However, I personally find physical properties more intuitive since that's what I've been using for so long.
I'm curious about what other developers actually use in their day-to-day work.
Do you exclusively use logical properties?
Do you still prefer physical properties?
Do you use a combination of both?
Is it worth making the switch even if you're primarily building websites for languages that use left-to-right writing directions?
I'd like to hear your opinions and experiences, especially from developers who have been working with CSS professionally for a while.