Giter Site home page Giter Site logo

blocks's Introduction

Blocks

Platform differences

lineHeight

type PixelLineHeight = string;
type RelativeLineHeight = number;
/* Web */
type LineHeight = RelativeLineHeight | PixelLineHeight;
/* iOS & Android */
type LineHeight = PixelLineHeight;
type LineHeight = PixelLineHeight;

borderStyle

/**
 * Web
 *
 * @required for border to appear
 *
 * @default "none"
 */
type BorderStyle =
  | "none"
  | "hidden"
  | "dotted"
  | "dashed"
  | "solid"
  | "double"
  | "groove"
  | "ridge";

/**
 * iOS & Android
 *
 * @optional
 *
 * @default "solid"
 */
type BorderStyle = "solid" | "dotted" | "dashed";
/**
 * blocks
 *
 * @optional
 *
 * @default "solid"
 */
type BorderStyle = "solid" | "dotted" | "dashed";

boxSizing

/**
 * Web
 *
 * @optional
 *
 * @default "content-box"
 */
type BoxSizing = "content-box" | "border-box";

/**
 * iOS & Android
 *
 * @default "border-box"
 */
type BoxSizing = "border-box";
/**
 * blocks
 *
 * @default "border-box"
 */
type BoxSizing = "border-box";

shadow

/**
 * Web
 *
 * @optional
 *
 * @default "none"
 */
interface Shadow {
  inset?: boolean;
  offsetX: PixelValue;
  offsetY: PixelValue;
  blurRadius: PixelValue;
  spreadRadius: PixelValue;
  color: Color;
}

/**
 * iOS
 *
 * @optional
 *
 * @default undefined
 */

interface ShadowOffset {
  width: number; // x
  height: number; // y
}

interface Shadow {
  shadowColor: Color;
  shadowOffset: ShadowOffset;
  shadowOpacity: number;
  shadowRadius: number;
}

/**
 * Android
 *
 * @optional
 *
 * @default undefined
 */

interface Shadow {
  elevation: number;
}
/**
 * blocks
 *
 * @optional
 *
 * @default undefined
 */
interface Shadow {
  color: Color;
  offset: {
    x: number;
    y: number;
  };
  opacity: number;
  radius: number;
}

fontFamily

/**
 * Web, iOS, Android & blocks
 *
 * @optional
 *
 * @default OS/Device Specific
 *
 * String specified is unique per platform hence it's inclusion.
 */
type FontFamily = string;

CSS Values

display

/**
 * Web
 *
 * @optional
 *
 * @default element specific
 */

type Display = "block" | "grid" | "flex" | "inline" | "table" ...

/**
 * iOS & Android
 *
 * @optional
 *
 * @default "flex"
 */

type Display = "flex"
/**
 * blocks
 *
 * @optional
 *
 * @default "flex"
 */

type Display = "flex";

Rendering Text

On Web you're able to render text anywhere in the DOM, on iOS & Android you can only render text inside a <Text /> component. Blocks adheres to this convention, meaning that any text must be wrapped in a <Text /> component.

Outline / Border

Border is supported on Web, iOS and Android. Outline is only supported on Web. Therefore blocks only supports border at this present time.

blocks's People

Contributors

aaronschubert0 avatar

Watchers

 avatar  avatar

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.