How to use stylesheet - 10 common examples

To help you get started, we’ve selected a few stylesheet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fengjundev / DoubanMovie-React-Native / node_modules / react-native / Libraries / ReactIOS / renderApplication.ios.js View on Github external
'Expect to have a valid rootTag, instead got ', rootTag
  );
  /* eslint-disable jsx-no-undef-with-namespace */
  React.render(
    
      
    ,
    rootTag
  );
  /* eslint-enable jsx-no-undef-with-namespace */
}

var styles = StyleSheet.create({
  appContainer: {
    flex: 1,
  },
});

module.exports = renderApplication;
github root-two / react-native-drawer / examples / iosDemo / node_modules / react-native / Libraries / CustomComponents / Navigator / Navigator.js View on Github external
var invariant = require('invariant');
var keyMirror = require('keyMirror');
var merge = require('merge');
var rebound = require('rebound');

var PropTypes = React.PropTypes;

var OFF_SCREEN = {style: {opacity: 0}};

var __uid = 0;
function getuid() {
  return __uid++;
}

// styles moved to the top of the file so getDefaultProps can refer to it
var styles = StyleSheet.create({
  container: {
    flex: 1,
    overflow: 'hidden',
  },
  defaultSceneStyle: {
    position: 'absolute',
    left: 0,
    right: 0,
    bottom: 0,
    top: 0,
  },
  currentScene: {
    position: 'absolute',
    overflow: 'hidden',
    left: 0,
    right: 0,
github fengjundev / DoubanMovie-React-Native / node_modules / react-native / Libraries / CustomComponents / Navigator / Navigator.js View on Github external
var key = '__navigatorRouteID';

  if (!route.hasOwnProperty(key)) {
    Object.defineProperty(route, key, {
      enumerable: false,
      configurable: false,
      writable: false,
      value: getuid(),
    });
  }
  return route[key];
}

// styles moved to the top of the file so getDefaultProps can refer to it
var styles = StyleSheet.create({
  container: {
    flex: 1,
    overflow: 'hidden',
  },
  defaultSceneStyle: {
    position: 'absolute',
    left: 0,
    right: 0,
    bottom: 0,
    top: 0,
  },
  baseScene: {
    position: 'absolute',
    overflow: 'hidden',
    left: 0,
    right: 0,
github expo / xde / node_modules / react-native / Libraries / CustomComponents / Navigator / Navigator.js View on Github external
var key = '__navigatorRouteID';

  if (!route.hasOwnProperty(key)) {
    Object.defineProperty(route, key, {
      enumerable: false,
      configurable: false,
      writable: false,
      value: getuid(),
    });
  }
  return route[key];
}

// styles moved to the top of the file so getDefaultProps can refer to it
var styles = StyleSheet.create({
  container: {
    flex: 1,
    overflow: 'hidden',
  },
  defaultSceneStyle: {
    position: 'absolute',
    left: 0,
    right: 0,
    bottom: 0,
    top: 0,
  },
  baseScene: {
    position: 'absolute',
    overflow: 'hidden',
    left: 0,
    right: 0,
github microsoft / react-native-windows / Libraries / CustomComponents / Navigator / Navigator.js View on Github external
var key = '__navigatorRouteID';

  if (!route.hasOwnProperty(key)) {
    Object.defineProperty(route, key, {
      enumerable: false,
      configurable: false,
      writable: false,
      value: getuid(),
    });
  }
  return route[key];
}

// styles moved to the top of the file so getDefaultProps can refer to it
var styles = StyleSheet.create({
  container: {
    flex: 1,
    overflow: 'hidden',
  },
  defaultSceneStyle: {
    position: 'absolute',
    left: 0,
    right: 0,
    bottom: 0,
    top: 0,
  },
  baseScene: {
    position: 'absolute',
    overflow: 'hidden',
    left: 0,
    right: 0,
github lenaten / react-native-relay / node_modules / react-native / Libraries / RCTTest / SnapshotViewIOS.ios.js View on Github external
onSnapshotReady={onSnapshotReady}
        testIdentifier={testIdentifier}
      />
    );
  },

  propTypes: {
    ...View.propTypes,
    // A callback when the Snapshot view is ready to be compared
    onSnapshotReady : React.PropTypes.func,
    // A name to identify the individual instance to the SnapshotView
    testIdentifier : React.PropTypes.string,
  }
});

var style = StyleSheet.create({
  snapshot: {
    flex: 1,
  },
});

// Verify that RCTSnapshot is part of the UIManager since it is only loaded
// if you have linked against RCTTest like in tests, otherwise we will have
// a warning printed out
var RCTSnapshot = UIManager.RCTSnapshot ?
  requireNativeComponent('RCTSnapshot', SnapshotViewIOS) :
  View;

module.exports = SnapshotViewIOS;
github expo / expo / android / ReactAndroid / src / androidTest / js / UIManagerTestModule.js View on Github external
* @providesModule UIManagerTestModule
 */

'use strict';

var BatchedBridge = require('BatchedBridge');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
var Text = require('Text');

var createReactClass = require('create-react-class');
var renderApplication = require('renderApplication');

var FlexTestApp = createReactClass({
  _styles: StyleSheet.create({
    container: {
      width: 200,
      height: 200,
      flexDirection: 'row',
    },
    child: {
      flex: 1,
    },
    absolute: {
      position: 'absolute',
      top: 15,
      left: 10,
      width: 50,
      height: 60,
    }
  }),
github fengjundev / DoubanMovie-React-Native / node_modules / react-native / Libraries / Components / WebView / WebView.ios.js View on Github external
this.setState({
      viewState: WebViewState.IDLE,
    });
    this.updateNavigationState(event);
  },
});

var RCTWebView = requireNativeComponent('RCTWebView', WebView, {
  nativeOnly: {
    onLoadingStart: true,
    onLoadingError: true,
    onLoadingFinish: true,
  },
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  errorContainer: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: BGWASH,
  },
  errorText: {
    fontSize: 14,
    textAlign: 'center',
    marginBottom: 2,
  },
  errorTextTitle: {
    fontSize: 15,
github fengjundev / DoubanMovie-React-Native / node_modules / react-native / Libraries / Components / SliderIOS / SliderIOS.ios.js View on Github external
let {style, ...props} = this.props;
    style = [styles.slider, this.props.style];

    return (
      
    );
  }
});

var styles = StyleSheet.create({
  slider: {
    height: 40,
  },
});

var RCTSlider = requireNativeComponent('RCTSlider', SliderIOS);

module.exports = SliderIOS;
github fengjundev / DoubanMovie-React-Native / node_modules / react-native / Libraries / Components / ScrollView / ScrollView.js View on Github external
}
    }
    invariant(
      ScrollViewClass !== undefined,
      'ScrollViewClass must not be undefined'
    );

    return (
      
        {contentContainer}
      
    );
  }
});

var styles = StyleSheet.create({
  base: {
    flex: 1,
  },
  contentContainerHorizontal: {
    alignSelf: 'flex-start',
    flexDirection: 'row',
  },
});

var validAttributes = {
  ...ReactNativeViewAttributes.UIView,
  alwaysBounceHorizontal: true,
  alwaysBounceVertical: true,
  automaticallyAdjustContentInsets: true,
  bounces: true,
  centerContent: true,

stylesheet

Dynamic CSS for user interfaces

MIT
Latest version published 7 years ago

Package Health Score

36 / 100
Full package analysis

Popular stylesheet functions