-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #1542 - Update PrimeFlex documentation to 2.0.0
- Loading branch information
1 parent
04937f4
commit 3e47c7f
Showing
6 changed files
with
156 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
.flexgrid-demo { | ||
.flexbox-demo { | ||
.p-d-flex > div, | ||
.box { | ||
background-color: var(--surface-e); | ||
text-align: center; | ||
padding-top: 1rem; | ||
padding-bottom: 1rem; | ||
padding: 1rem; | ||
border-radius: 4px; | ||
box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12); | ||
} | ||
|
||
.box-stretched { | ||
height: 100%; | ||
} | ||
|
||
.vertical-container { | ||
margin: 0; | ||
height: 200px; | ||
background: var(--surface-d); | ||
border-radius: 4px; | ||
} | ||
|
||
.nested-grid .p-col-4 { | ||
padding-bottom: 1rem; | ||
} | ||
|
||
p { | ||
margin: 0; | ||
.p-d-flex > div { | ||
width: 8rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import React, { Component } from 'react'; | ||
import { CodeHighlight } from '../codehighlight/CodeHighlight'; | ||
|
||
export class PrimeFlexSetup extends Component { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<div className="content-section documentation"> | ||
<h1>PrimeFlex</h1> | ||
<p>PrimeFlex is a CSS utility library featuring various helpers such as a grid system, flexbox, spacing, elevation and more. Although it is not required, it is highly | ||
recommended to add PrimeFlex as it is likely to need such utilities when developing applications with PrimeVue.</p> | ||
|
||
<h5>Download</h5> | ||
<p>PrimeFlex is available at <a href="https://www.npmjs.com/package/primeflex">npm</a>, if you have an existing application run the following commands to install it.</p> | ||
|
||
<CodeHighlight lang="js"> | ||
{` | ||
npm install primeflex --save | ||
`} | ||
</CodeHighlight> | ||
|
||
<h5>Import</h5> | ||
<p>Next step is adding the primeflex.css to your application to include all utilities. If you prefer to pick the utilities, move to next step instead.</p> | ||
|
||
<CodeHighlight lang="css"> | ||
{` | ||
import 'primeflex/primeflex.css'; | ||
`} | ||
</CodeHighlight> | ||
|
||
<p>PrimeFlex is a lightweight library still if you have an application such as one based on vue-cli | ||
that is able to import scss then you will be able to pick the utilities you need to make the app bundle even smaller.</p> | ||
<CodeHighlight lang="css"> | ||
{` | ||
import 'primeflex/src/_variables.scss'; | ||
import 'primeflex/src/_grid.scss'; | ||
import 'primeflex/src/_formlayout.scss'; | ||
import 'primeflex/src/_display.scss'; | ||
import 'primeflex/src/_text.scss'; | ||
import 'primeflex/src/flexbox/_flexbox.scss'; | ||
import 'primeflex/src/_spacing.scss'; | ||
import 'primeflex/src/_elevation.scss'; | ||
`} | ||
</CodeHighlight> | ||
|
||
<h5>Variables</h5> | ||
<div className="doc-tablewrapper"> | ||
<table className="doc-table"> | ||
<thead> | ||
<tr> | ||
<th>Variable</th> | ||
<th>Description</th> | ||
<th>Default</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>$sm</td> | ||
<td>Breakpoint of screens such as phones.</td> | ||
<td>576px</td> | ||
</tr> | ||
<tr> | ||
<td>$md</td> | ||
<td>Breakpoint of screens such as tablets.</td> | ||
<td>768px</td> | ||
</tr> | ||
<tr> | ||
<td>$lg</td> | ||
<td>Breakpoint of screens such as notebook monitors.</td> | ||
<td>992px</td> | ||
</tr> | ||
<tr> | ||
<td>$xl</td> | ||
<td>Breakpoint of smaller screens such as desktop monitors.</td> | ||
<td>1200px</td> | ||
</tr> | ||
<tr> | ||
<td>$gutter</td> | ||
<td>Padding of a grid column.</td> | ||
<td>.5rem</td> | ||
</tr> | ||
<tr> | ||
<td>$fieldMargin</td> | ||
<td>Spacing of a field. Can be vertical of horizontal depending on form layout.</td> | ||
<td>.5rem</td> | ||
</tr> | ||
<tr> | ||
<td>$fieldLabelMargin</td> | ||
<td>Spacing of a field label. Can be vertical of horizontal depending on form layout.</td> | ||
<td>.5rem</td> | ||
</tr> | ||
<tr> | ||
<td>$helperTextMargin</td> | ||
<td>Top spacing of a helper text.</td> | ||
<td>.5rem</td> | ||
</tr> | ||
<tr> | ||
<td>$spacer</td> | ||
<td>Base value to use in spacing utilities, view spacing documentation for details.</td> | ||
<td>.5rem</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<p>There are two ways to use these variables, one option is getting the source code of PrimeFlex from github, compile your own primeflex and importing the css file. Other | ||
alternative is importing your own variables to override the defaults if your application can import scss files. Example below overrides breakpoints; | ||
</p> | ||
|
||
<p><b>_overrides.scss</b></p> | ||
<CodeHighlight lang="css"> | ||
{` | ||
$sm:640px; | ||
$md:720px; | ||
$lg:960px; | ||
$xl:1080px; | ||
`} | ||
</CodeHighlight> | ||
|
||
<CodeHighlight lang="css"> | ||
{` | ||
import './assets/_overrides.scss'; | ||
import 'primeflex/src/_variables.css'; | ||
import 'primeflex/src/_grid.css'; | ||
import 'primeflex/src/_formlayour.css'; | ||
import 'primeflex/src/_display.css'; | ||
import 'primeflex/src/_text.css'; | ||
import 'primeflex/src/flexbox/_flexbox.css'; | ||
import 'primeflex/src/_spacing.css'; | ||
import 'primeflex/src/_elevation.css'; | ||
`} | ||
</CodeHighlight> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |