
Mariusz Michalski
@mariuszm82
Followers
55
Following
11K
Media
3
Statuses
11K
Joined October 2015
🧠 Did you know:.With @nuxt_js, you can use the context property on the event object to add custom data in middleware, making it accessible in your server routes? This is useful for passing information like authentication status or user details throughout your app:
0
0
1
Pro @tailwindcss design system tip:. Create an `initial:` variant to set default styles that can be overridden by utility classes
0
0
0
💡Tip of the day:.When writing unit tests, @nuxt_js provides the `mountSuspended` helper, which allows you to mount any component within your Nuxt context, even if it uses async setup. This makes it easy to test components that rely on asynchronous data or lifecycle hooks.
0
0
1
#css.
💡 CSS Tip!. Similar to the :nth-child() trick, we can implement media queries using if() and calculation!. Why reinvent the wheel? With this, you can update the width value on the fly (using variables for example). You cannot do it with native queries.
0
0
0
We can also simulate container queries by using cqw instead of vw. Demo: via @CodePen . The layout of the demo responds to the width of the wrapper without a single media query or container query!
0
0
0
#css.
🥳 CSS functions have arrived!!! 🥳. And they are *AWESOME*. Now, you can do things like this:. @function --alpha(--color, --opacity) {. result: rgb(from var(--color) r g b / var(--opacity));.}. div {. background: --alpha(red, 80%);.}. (*arrived = in the latest stable Chrome).
0
0
0
💡 Tip of the day:.To handle global errors in @nuxt_js, you should use the provided composables and utilities: `useError`, `clearError`, `createError`, and `showError`. These tools allow you to programmatically manage errors that occur during server-side or universal rendering.
0
0
1