Coder Social home page Coder Social logo

patternfly / patternfly-3 Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 241.0 96.61 MB

This repo contains the HTML, CSS, and JQuery for the PatternFly 3 project.

Home Page: https://www.patternfly.org/v3

License: MIT License

JavaScript 11.10% HTML 47.94% CSS 40.70% Ruby 0.25% Shell 0.01%

patternfly-3's Introduction

PatternFly 5

Install

When you install PatternFly 5, the package includes:

  • a single file for the entire compiled library: node_modules/@patternfly/patternfly/patternfly.css
  • individual files with each component compiled separately: node_modules/@patternfly/patternfly/<ComponentName>/styles.css
  • a single file for the entire library's source (SASS): node_modules/@patternfly/patternfly/patternfly.scss
  • individual files for each component's source (SASS): node_modules/@patternfly/patternfly/<ComponentName>/styles.scss

Any of the files above are meant for use in consuming the library. The recommended consumption approach will vary from project to project.

Development

PatternFly 5 Development requires Node v16.0.0 or greater

To setup the PatternFly 5 development environment:

  • clone the project
  • run yarn install from the project root
  • run yarn start
  • open your browser to http://localhost:8001

After working on your contribution, check for accessibility violations.

Create components, layouts...

To create source file scaffolding for a new component, layout, utility, or demo, run the NPM script:

node generate <CamelName>

Below are the full options for this script:

Options:
  -f, --folder <folder>  Source folder (components, demos, layouts, or utilities) (default: "components")

Examples

To create a "Test component" component (.pf-v5-c-test-component), run:

node generate TestComponent

To create a "Test layout" layout (.pf-l-test-layout), run:

node generate TestLayout -f layouts

To create 3 new demos named "Test demo", "Test demo 2", and "Test demo 3", run:

node generate TestDemo TestDemo2 TestDemo3 -f demos

Update screenshots

When making visual changes to a full page example, new example preview screenshots must be generated. To update the screenshots:

  • open a terminal and run yarn build && yarn serve
  • in another terminal, run yarn screenshots

Guidelines for CSS development

  • For issues created in Core that will affect a component in PF-React, a follow up issue must be created in PF-React once the Pull Request is merged. The issue should include the Core PR #, the Core Release, a link to the component in https://core-staging.patternfly.org, and information detailing the change.
  • If global variables are modified in Core, a React issue should be opened to address this.
  • CSS developers should ensure that animation is well documented and communicated to the respective React developer.
  • Once the component/enhancement is complete it should receive sign off from a visual designer who can then update the master sketch file with any changes.

Handlebars guidelines

For information on how to contribute, refer to our guidelines.

CSS/Sass guidelines

For more information on using CSS and Sass, refer to our guidelines.

Custom icon guidelines

For more information on custom icons, refer to our guidelines.

Beta components

When creating a brand new component, it should be released as beta in order to get feedback.

Testing for accessibility

PatternFly uses aXe: The Accessibility Engine to check for accessibility violations. Our goal is to meet WCAG 2.0 AA requirements, as noted in our Accessibility guide.

How to perform an accessibility audit with aXe

aXe is available as either a browser extension or npm script.

To run the a11y audit locally:

  • install the latest chromedriver and ensure its available on your system $PATH
    • macOS users can simply brew cask install chromedriver
  • open a terminal and run yarn build && yarn serve
  • in another terminal, run yarn a11y

The tool is configured to return WCAG 2.0 AA violations for the full page renderings of all components, layouts, utilities, and demos. The tool will provide feedback about what the violation is and a link to documentation about how to address the violation.

The same tool is also available as a browser extension for Chrome and Firefox.

Fixing violations

Ignore the violations that aren’t related to your contribution.

Fix violations related to your contribution.

If there are violations that are not obvious how to fix, then create an issue with information about the violation that was found. For example, some violations might require further discussion before they can be addressed. And some violations may not be valid and require changes to the workspace or tooling to stop flagging the violation.

If you have any suggestions about ways that we can improve how we use this tool, please let us know by opening an issue.

FAQ

CSS Variables

How do I use CSS variables to customize the library?

Browser support

PatternFly 5 is supported on the latest two major versions of the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge

patternfly-3's People

Contributors

adamj avatar amarie401 avatar andresgalante avatar bleathem avatar cardosogabriel avatar cdcabrera avatar cliffpyles avatar dabeng avatar dgutride avatar dlabrecq avatar dtaylor113 avatar gregsheremeta avatar jeff-phillips-18 avatar jgiardino avatar junezhang avatar knokit avatar lhinson avatar matthewcarleton avatar mcoker avatar michaelkro avatar michpetrov avatar nireno avatar patternfly-build avatar priley86 avatar redallen avatar rhamilto avatar skateman avatar srambach avatar stefwalter avatar therealjon 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  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  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  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

patternfly-3's Issues

.glyphicon has unexpected "top" style.

patternfly.css 1.1.3 contains this snippet:

.glyphicon {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

The "top: 1px" causes a button with a glyphicon to be out of alignment (see screenshot).

The HTML for the buttons in the screenshot:

            <div id="dashboard-toolbar" class="pull-right zoom-controls">
              <div class="dropdown" style="display:inline-block">
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                  <span style="width:6em;text-align:left;padding-left:5px;display:inline-block"></span>
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                  <li role="presentation"><a role="menuitem" tabindex="-1" data-action="goto-now">Go to now</a></li>
                  <li role="presentation" class="divider"></li>
                  <li role="presentation"><a role="menuitem" tabindex="-1" data-range="300">5 minutes</a></li>
                  <li role="presentation"><a role="menuitem" tabindex="-1" data-range="3600">1 hour</a></li>
                  <li role="presentation"><a role="menuitem" tabindex="-1" data-range="21600">6 hours</a></li>
                  <li role="presentation"><a role="menuitem" tabindex="-1" data-range="86400">1 day</a></li>
                  <li role="presentation"><a role="menuitem" tabindex="-1" data-range="604800">1 week</a></li>
                </ul>
              </div>
              <button class="btn btn-default glyphicon glyphicon-zoom-out" data-action="zoom-out"></button>
              <div class="btn-group">
                <button class="btn btn-default fa fa-angle-left" data-action="scroll-left"></button>
                <button class="btn btn-default fa fa-angle-right" data-action="scroll-right"></button>
              </div>
            </div>

We are working around this with this CSS:

.btn.glyphicon {
    top: 0px;
}

What's your recommendation?

glyphbutton

class*="-exclamation" affects other stylesheets

The following rule in less/icons.less affects other projects classes and seems to be needlessly broad:

[class*="-exclamation"] {
  color: #fff;
}

In particular in Cockpit it makes certain things show up in white as they change state.

mixed IE8 support

PatternFly says

Since PatternFly is based on Bootstrap, PatternFly supports the same browsers as Bootstrap

This includes IE8.

However, the dependency tree pulls in jquery > 2, which is not IE8 compatible.

PatternFly should explicitly pull in jquery < 2.

Full page example

A full page/site example is needed. At the very least a cmplete page with navigation, some tables, etc.

Another option for login

From https://www.patternfly.org/wikis/patterns/user-authentication/loginlogout/ , the login page is really stunning!

However, I'd like to have another supported option for login. Clicking on the 'Login' button will provide a pop-up that will ask for Login credentials. That will, IMO, probably make the Login process more seamless and fluid. If the user decides he doesn't want to login after all, he/she can just click on [x] or any other part of the screen to get out of the Login pop-up.

Problem with glyphicons -> dependency on bootstrap

In patternfly.css, glyphicons are fetched from components/ directory:

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('../../components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot');
  src: url('../../components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../../components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff') format('woff'), url('../../components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../../components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

Problem is that components directory is not stated anywhere as dependency, and you also say that patternfly does not depend on bootstrap, which seems incorrect from this.
I expect everything important to be in dist, so when building my web application which does minification and similat operations I get an error because I had no reason to know that stuff from components directory has to be copied.

patternfly components - what is that for?

When I install patternfly from bower, there is a components folder inside. What is that for? All of those are stated under devDependencies in bower.json, but it seems to me like all this is needed for patternfly to work. If that is correct, why are they not normal dependencies?

Font awesome only

Bootstrap uses this: http://fontawesome.io/icons/

I add the icons by doing this:

<span class="fa fa-user"></span> 

Why is patternfly using Icomoon?
It causes freak implementations:

<span class="pficon pficon-user"></span>

Website down?

Hi there,

Seems like the website is down.. maybe maintenance.. But I miss it nevertheless.
Might be a good idea to move the Patternfly website to some RHEV managed cluster! πŸ’ƒ πŸ˜„

Search component example not working well for server side search

If you have a workflow where you display a page with search form to the user, who fills in their query and submits the form back to the server that returns a new page, there are several issues with the example code.

  1. Clicking the search button does not submit the form. The user has to submit via keyboard. Specifying the button type as submit fixes this.
  2. If the form is displayed again on the result page, the input field contains submitted text, but the clear button is hidden. This can be fixed by using
$(".search-pf .clear").toggle(!$(this).prev('input').val());

instead of the hide call which (according to docs) does not support boolean argument.

Small text on PatternFly.org?

Not sure if PatternFly.org represents a default PatternFly theme, but the text is tiny, verging on non-compliance with WCAG. Consider using a more readable font or increasing the font size by default.

Sidebar code fails if no navbar

In Cockpit we have the navbar in an outer frame, rather than in the document itself. The sidebar logic looks for this before setting the height of .sidebar-pf:

    if ( $('.navbar-pf .navbar-toggle').is(':hidden') ) {

This causes the sidebar not to work, unless we put an invisible hack of a navbar inside the document. Is there a better way to determine whether we're on mobile or not?

Backgrounds should be optional

1# Case one
Consider this:
I do not want a background image, but a color.

Situation:
Open the patteryfly css.. remove the background-image attribute.

Problem:
When updating patternfly, my changes will be overridden

Temp solution:
I could add my own css, but than it will download the image anyways..eventhough it will not use it. Because it is in the patternfly css which is loaded.

2# Case two
Consider this:
I want a custom background image.

Situation:
Open the patteryfly directory and replace the image.

Problem:
When updating patternfly, my changes will be overridden.

Pagination issue on datatable

Hi

I think the datatable plugin bundled with patternfly JS has some issues when you configure datatable with "server processing" feature: It wont show appropriate pagination length, buttons and numbers.

Thanks for this awesome work!

Dashboard widgets

Hi there,

What are the libraries behind the dashboard graph? Right now they are just images, but I would like to implement these, so could you please tell me?

Javascript Libraries

Hi there,

is there a list of javascript libraries that will be included in the future? Things like the c3js library?
I ask this, because it could happen that some systems require documents need to be uploaded, or images even. Imagine a whitelabel enabled reseller SAAS dashboard for instance.
In that case, what image uploading libraries would one use?

Date picker

Add a pattern/widget for inputting dates and times

Is bootstrap a dependency

I am interested if bootstrap is in any way dependency for patternfly? Do I have to include bootstrap js or css in order for patternfly to work? Thank you

placeholder text makes input field look disabled

Having placeholder text in an input field makes it look disabled. The port fields in the screenshot (with none placeholders) do not look like I can type into them because their contents are the same grey as a disabled field (eg: the disabled 'TCP' dropdown).

screenshot from 2015-01-22 11 33 39

Ugly looking alert octagon exclam icons

Unfortunately, the alert octagon exclam icons look misaligned and quite amateur when rendered on Linux. I would suggest not using overlay at all to get consistent behavior across browsers and operating systems.

screenshot from 2015-04-16 10-17-06

fonts are too small

I think body font-size=11px is horribly small.
In github, g+ and gmail default theme, it's 13px. In bootstrap-3 default is 14px.
11px is just too small.

Wrong path for bootstrap in examples

Hi,

  • I've noticed that most (or all?) of the examples in the project (inside the test folder) defines the wrong path for bootstrap.min.js. In this case, the folder does not exist.
    e.g https://github.com/patternfly/patternfly/blob/master/tests/accordions.html#L19
  • I've also noticed that my browser could not display some icons.
    OS: Fedora 20
    Browser: Firefox 29
    screenshot from 2014-05-01 13 55 37
  • Last thing I wanted to mention was that the example uses
    <script src="//code.jquery.com/jquery-1.10.2.min.js"></script> [1]
    This would work fine if the examples were put in an HTTP server and we would launch it with http://<example>/dashboard.html . However, I would think that users will usually launch it from the file itself with file:///home/dcheung/<extra_paths>/dashboard.html, and in that case, the JQuery code won't be downloaded.
    So I'd suggest we switch to http://code.jquery.com/jquery-1.10.2.min.js

[1]: e.g https://github.com/patternfly/patternfly/blob/master/tests/dashboard.html#L15

Collapse plugin not present

The collapse plugin from Bootstrap seems not to be present in the patternfly.js file. If is a feature then the documentation should mention it and provide simple way how to get standalone collapse plugin.

Extended form controls

Hi there,

What libraries are going to be included for extended form controls, like

  • range-sliders
  • on/off toggle

and other stuff that would be nice in a app where you can scale infrastructure by hand.

Error in dropdown

We have a form in Cockpit where if nothing is selected in the dropdown, gives you an error and a small note that you need to select something in this dropdown, similar to the text fields.
This could probably be of use to the rest of patternfly as well.

The css is:
.has-error > .bootstrap-select > button > span {
color: #A94442;
}

Login - assumtions about dom structure

I was implementing login page and encountered several style limitations.

  1. Assumption that it will be the top level and only page with this structure in DOM. Its difficult to place the login screen to some containing element and avoid touching html and body element.
    • .login-pf body -> .login-pf .login-pf-body
  2. Usage of ids instead of classes prevents to have two instances in DOM.
    • #brand -> .login-pf-brand
    • #badge -> .login-pf-badge
  3. It might be better to have to 2 .rows in .container. First containing #brand and second containing .login and .details. The semi-transparent background would be transferred to the second. It will allow to remove the -70px relative position from #badge a thus remove the height: 18px assumption on #badge img. In the end it should allow to use images with variable height without additional styles - good for branding.
  4. background images with non-uniform bottom (more colors than just @login-bg-color) don't look good on tall (screen height > displayed bg img height) and medium width (768px < screen width < 1200px) screens. In this interval the image doesn't cover whole screen so the @login-bg-color color is displayed on the bottom part, creating a hard visible transition. The example PatternFly background doesn't suffer from this issue since it has quite uniform bottom colors making the transition smooth. I'm not sure what should be the proper fix for other images. Maybe to use better image.

If there is some consensus, I can create patch for issues 1,2,3. The bad part is that these changes are not backwards compatible.

very slim dropdown of combobox

Compared to the bootstrap-select widget the dropdown of the bootstrap-combobox is very slim.
Setting the width of .dropdown-menu to 100% seems to do the trick.

Font-awesome / Glyphicons links in distribution point outside of distribution

In dist/css/patternfly.css:

@font-face {
  font-family: 'FontAwesome';
  src: url('../../components/font-awesome/fonts/fontawesome-webfont.eot?v=4.0.3');
  ...
}

This works during patternfly development, but it does not work when using patternfly as bower dependency, installed in bower_components directory (project specific):

GET http://localhost:8080/ag-push/bower_components/patternfly/components/font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0 404 (Not Found)
GET http://localhost:8080/ag-push/bower_components/patternfly/components/font-awesome/fonts/fontawesome-webfont.ttf?v=4.1.0 404 (Not Found)
GET http://localhost:8080/ag-push/bower_components/patternfly/components/font-awesome/fonts/fontawesome-webfont.svg?v=4.1.0 404 (Not Found) 

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.