An open API service indexing awesome lists of open source software.

https://github.com/catamphetamine/social-components-react

React implementation of `social-components` data structures
https://github.com/catamphetamine/social-components-react

Last synced: 3 months ago
JSON representation

React implementation of `social-components` data structures

Awesome Lists containing this project

README

        

# `social-components-react`

A React implemenation of [`social-components`](https://npmjs.com/package/social-components) data structures, along with generic social service React components.

## Install

Clone the repository:

```
git clone https://gitlab.com/catamphetamine/frontend-lib.git
git clone https://gitlab.com/catamphetamine/social-components-react.git
```

## Use

Simply `import` components from the repository directory:

```js
import Post from '../../social-components-react/components/Post.js'
```

The reason for using these components as source code instead of importing them from an npm package is because a developer might prefer to modify them.

### Styles

Styles are defined in [`./style/variables.css`](https://gitlab.com/catamphetamine/social-components-react/blob/master/style/variables.css) and should be included on a page.

```css
@import "../../social-components-react/style/variables.css";
```

A developer might want to define some global "defaults", along with overriding some of the variables' values:

```css
@import "../../social-components-react/style/variables.css";

:root {
/* A "modular grid" unit. */
--unit: 14px;

/* The color of the white color. Could be dimmed a little bit in Dark Mode. */
--white-color: white;

/* Text settings. */
--SocialComponents-fontFamily: sans-serif;
--SocialComponents-fontFamily--text: serif;
--SocialComponents-lineHeight: 1.35em;

/* Color (from light to dark) */
--SocialComponents-color-100: #eaeaea;
--SocialComponents-color-200: #dddddd;
--SocialComponents-color-300: #cecece;
--SocialComponents-color-400: #b7b7b7;
--SocialComponents-color-500: #999999;
--SocialComponents-color-600: #7b7b7b;
--SocialComponents-color-700: #666666;
--SocialComponents-color-800: #555555;
--SocialComponents-color-900: #444444;

/* Background Color */
--SocialComponents-backgroundColor: white;

/* Clickable Color */
--SocialComponentsClickable-color: orange;
--SocialComponentsClickable-color--active: yellow;
/* "Clickable text" buttons are usually colored a bit darker. */
--SocialComponentsClickable-color--text: brown;
}
```

Light Mode / Dark Mode styles are defined by `"light"` or `"dark"` CSS class being added to the `