fresh icon indicating copy to clipboard operation
fresh copied to clipboard

Could you add additional css options to the documentation

Open timscodebase opened this issue 1 year ago • 9 comments

I am not a fan of tailwind css. Could you add instructions for "vanilla CSS"?

timscodebase avatar Jul 11 '22 23:07 timscodebase

Coming soon

lucacasonato avatar Jul 12 '22 13:07 lucacasonato

Please let me know if I can help. This is an awesome project! 🏆🔥

timscodebase avatar Jul 12 '22 23:07 timscodebase

It'd be great to see Vanilla Extract represented here as well!

davidhousedev avatar Jul 16 '22 14:07 davidhousedev

@davidhousedev What do you me buy "Vanilla Extract"?

timscodebase avatar Jul 21 '22 04:07 timscodebase

@ry @jed Where would I put a styles directory?

timscodebase avatar Jul 21 '22 04:07 timscodebase

@timscodebase I think currently, a styles directory goes in the static folder

ZackarySantana avatar Jul 23 '22 03:07 ZackarySantana

@timscodebase see here: https://vanilla-extract.style

davidhousedev avatar Jul 23 '22 12:07 davidhousedev

@timscodebase see here: https://vanilla-extract.style

+1 for this type of thing. We have a home rolled system using Emotion https://emotion.sh/docs/introduction that does similar and its really nice to have CSS in JS

Why? (top of my head)

  • Variables in the objects
  • set mediaqeries breakpoints once, then use a function in the TS objects for the corresponding breakpoints so
import {Breakpoints as bp} from './comp/mediaqueries'

const styles = createStyles({
    main: {
        width: bp([200, 600, 1000, 1200])
    }
)

// Also programatically identiify devices 

import {isMobile, isTablet, isPortrait } from './comp/devices'

if(isMobile && isPortrait) {
    <RenderThisWickedComponent />
}

nhc avatar Jul 25 '22 19:07 nhc

I also use Emotion (although Vanilla Extract looks suuuper nice!) and it's further useful since it's easy to compose styles freely and decouple styling from the actual HTML markup, while having predictable and easy to understand style scoping. Looking forward to proper support for this stuff here, as it's one of my main blockers for using Fresh seriously.

osdiab avatar Sep 09 '22 07:09 osdiab

Any progress on this one? Would love to see vanilla-extract 🧁 as it goes well with the Fresh 🍋 philosophy.

rista404 avatar Nov 19 '22 13:11 rista404

I've made @emotion/css work with fresh for one of the projects. It works for islands and server-side rendered pages, but I didn't test it enough to call it production ready just yet.

Here's the gist if anyone is interested: https://gist.github.com/ValeriaVG/fae78394feee2ae44b9c58521a33d3e9

Example usage:

export default function Hero({ background, headline }: HeroProps) {
  return (
    <section
      class={heroClass}
    >
      {"image" in background && (
        <img
          src={background.image.url}
        />
      )}
      {"video" in background && (
        <video
          src={background.video.url}
          loop
          muted
        />
      )}
      <h1>{headline}</h1>
    </section>
  );
}

const heroClass = css`
min-height:50vh;
width: 100%;
box-sizing: border-box;
display: flex;
position:relative;
&>h1{
  font-size: 18px;
  color: white;
  position: absolute;
  bottom: 1rem;
  left:1rem;
  right:1rem;
  text-align:center;
  z-index:1;
}
&>img,&>video{
  width: 100%;
}
`;

ValeriaVG avatar Dec 02 '22 10:12 ValeriaVG

I already explain how to use tailwind css with Fresh. check out my article. I hope it work for you. for me it work fine

officialrajdeepsingh avatar Apr 04 '23 16:04 officialrajdeepsingh

@officialrajdeepsingh Literally the first comment of the issue is about how to NOT use Tailwind.

alex-kinokon avatar Apr 23 '23 21:04 alex-kinokon