Giter VIP home page Giter VIP logo

gls's Introduction

Hi there ๐Ÿ‘‹

I write and teach a lot of JavaScript/TypeScript. You can also find me on twitter ๐ŸŒน

YouTube Channel Subscribers

Follow on Twitter

GitHub Achievements

trophy

gls's People

Contributors

basarat avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

h09shais

gls's Issues

Backlog

Infrastructure

  • Move out vertical, horizontal, grid style generators to styles

Architecture

  • Defaults via react context
  • Consolidate defaults into a single consumer / provider
  • Export a single provider, internal useThemeCarefully
  • @design {icon} - svg 24x24 icons for components

GLS Props

  • border radius
  • styles
  • flex
  • tagProps

Components

  • Position relative style components
  • Responsive
  • Responsive Props Cascade
  • IDEA : Create a core flex box component.

Docs / Demos

  • Replicate TypeStyle Flex Docs
  • Document defaults overriding
  • GLS Props
  • Each component
  • Alignment for horizontal and vertical
  • Common UIs as Examples (https://typestyle.github.io/#/flex)
  • Flex ratio

Release

  • 0.1.0

Future

  • styles for animations

Can you explain why root should be flex container?

Just as the title.

const fragment = <>
  <Vertical width={300} scroll="both">{[...Array(20)].map((_, i) => <p key={i}>{short_text}</p>)}</Vertical>
  <Vertical sizing="flex" scroll="both">{[...Array(100)].map((_, i) => <p key={i}>{long_text}</p>)}</Vertical>
  <Vertical width={200} scroll="both">{[...Array(20)].map((_, i) => <p key={i}>{short_text}</p>)}</Vertical>
</>

// [email protected]
const gls_011 = <div id="root">
  <Horizontal height="100%">
    {fragment}
  </Horizontal>
</div>

// [email protected]
const gls_110 = <div id="root">
  <Horizontal width="100%">
    {fragment}
  </Horizontal>
</div>
const fragment = <>
  <label>
    ็”จๆˆทๅ: <input type="text" name="username" />
  </label>
  <label>
    ๅฏ† ็ : <input type="password" name="password" />
  </label>
  <button type="submit">็™ปๅฝ•</button>
</>

// [email protected]
const gls_011 = <div id="root">
  <Vertical height="100%" verticalAlign="center" horizontalAlign="center">
    {fragment}
  </Vertical>
</div>

// [email protected]
const gls_110 = <div id="root">
  <Vertical width="100%" verticalAlign="center" horizontalAlign="center">
    {fragment}
  </Vertical>
</div>

In both two examples, gls_011 behaves like gls_110, and it seems that code of gls_110 is not simpler than gls_011.

So, why should we have a flex root?

flexWrap

IMO Horizontal should flexWrap: "wrap" by default or at the very least it should have a prop to set this.

Thoughts?

NextJS?

Hi Basrat,

This is a fantastic lib and I use it for all my projects. I am just working on redoing my blog using NextJS and ofcourse im using GLS.

Im having an issue however that seems to be causing a reflow. I think its caused by styles being embedded in the JS which is loaded late.

I noticed your Gist here 14 months ago, I tried to implement it but im still getting the reflow issue.

You can see what I mean by going to the build URL: https://next-mikecann.vercel.app/

You will see the page is rendered okay but you get a flicker once the JS loads, this is evident if you open the inspector:

image

Im not sure whats causing this, do you know?

Incase you are interested the src is here: https://github.com/mikecann/next-mikecann

Cheers

Some thought on a helper for text

With baseFix (trim bottom) and heightFix (trim top). Rough version:

transform: `translateY(${baseFix})`

&:before: {
  content: "''",
  display: 'block',
  height: 0, 
  marginTop: -heightFix,
}

Needs to be tested for reliability (text wrapping, different font faces, units of text, wrapping). I've seen it go wrong (see screenshot), but a useful idea to share nonetheless.

image

There are also plans to add native support to CSS for this that will work more reliably (hopefully)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.