Pinned Tweet
Made final changes to my portfolio website.
ππ» Hero background color with updated heading.
ππ» Added Blog page for discoverability.
ππ» Sticky about section.
ππ» Development process timeline.
Link in Bio.
101
βpatternβ attribute can be used without requiredβrequiredβ attribute but it is ignored on input type βnumberβ.
html tip π’: zip codes, card numbers and one-time codes are text fields with a number keypad.
<πππππ ππ’ππ="πππ‘π" πππππππππ="πππππππ"
πππππππ="[πΆ-πΏ]{π»}" ππππππππππππ="ππππππ-ππππ">
ππ’ππ="ππππππ" is a ππππππππππ. arrow down on "πΆπΈπ·πΉπΏ" gives "πΈπ·πΉπΎ" and the leading zero is gone.
1
13
Zafar retweeted
Drag, in Reactive CSS:
.card {
--x: state(0px);
--y: state(0px);
translate: var(--x) var(--y);
touch-action: none;
}
.card:on(drag) {
--x: set(event(x));
--y: set(event(y));
}
event(x) continues from where the card stopped
reactivecss.com
And at times your cards might end up with different heights & meta section of the card might look misaligned. To fix that:
.card {
display:flex;
flex-direction:column;
.meta{margin-top:auto;}
}
CSS tip: cut long titles after 2 lines with a clean "β¦".
.card-title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
Works in every modern browser, Firefox included, despite the -webkit- prefix.
1
15
Tailwind & HTML tags attributes work differently but they both introduce one common issue which is readability.
First libs & frameworks were introduced to follow to avoid using many css class names & html attributes
π§΅
Replying to @calebporzio @Apply
Tailwind became popular to help you hand-write your CSS into pages. We are trending away from hand writing the CSS ... so I'm expecting us to be trending away from Tailwind embedded CSS.
Personally, I ask my agents to move the tailwind CSS out of the pages and back into css files with nested CSS structure.
Most of my Tailwind is being used with @apply directives.
1
15
Layout Reflow & layout recalculations are a few bottlenecks & performance issues linked to βdvhβ. Relying on static units such as svh & lvh while using dvh where it is needed would be a better approach.
Design engineering tip: 100vh is not always best choice
Size the screen by what is showing height: 100dvh
23
Never used audio & video elements that html5 offer out of the box but that looks promising.
Styling audio and video by state is now pure CSS. βπ»
`:playing`, `:paused`, `:muted`, `:seeking`, `:buffering`, `:stalled` and `:volume-locked` now work in every major engine: Chrome 158, Firefox 150, and Safari 15.4+.
No event listeners, no class toggling.
Before thisβ¦ Now ‡οΈ
1
24
Nextjs Link component is already optimized enough I think this one is over-think component.
Use Fast Link and your links start navigating on press, not on release.
That small gap between pressing and releasing the mouse is free time for the next page to load.
πππ πππππππ @ππππ-ππππ/πππ‘π
github.com/vercel-labs/fast-β¦
24
Way better than forms npm packages such as Formik which listens to each key release. One of the performance bottlenecks solved by CSS.
CSS tip: stop showing form errors before the user has typed anything.
input:user-invalid {
border-color: red;
}
:invalid turns fields red the moment the page loads. :user-invalid waits until the user has actually interacted with the field. Works in all major browsers.
1
18
Zafar retweeted
Git habits that make AI coding agents safe to use:
πΎ Commit before every agent task
πΏ One branch per feature
π§© Small commits you can revert on their own
π Read the full diff before committing
ποΈ Stage files on purpose, not git add .
π« Keep .env and secrets in .gitignore
π§ͺ Run the tests before every commit
π Stash and retry when a direction feels wrong
π³ Use worktrees to run agents in parallel
π Make commit messages explain the why
Git is your undo button.
Zafar retweeted
Design Engineering Tip:
Use tabular numbers for ticking timers. Proportional digits shift in width on every update.
.timer {
font-variant-numeric: tabular-nums;
}
WIP on Travel Agency website. Here is a βCustomer Reviews sectionβ.
Do you need to build your website? ππ» Link in Bio to book a free call.
WIP on Travel Agency website. Here is a βAbout Us sectionβ exploration.
Do you need to build your website? ππ» Link in comments to book a free call.












