Git Product home page Git Product logo

prestashop-ui-kit's Introduction

PrestaShop UI Kit

UI Kit integration for PrestaShop – Based on Bootstrap 4.

prestashop-ui-kit

Installation

Note: If you use PrestaShop, there's no need to install – the UI kit is already installed in PrestaShop.

You can install the UI kit on your project, independently from PrestaShop, using NPM.

npm install --save-dev prestakit

Or use it directly through our CDN:

[...]
<link href="https://ui-kit.prestashop.com/backoffice/latest/css/bootstrap-prestashop-ui-kit.css" rel="stylesheet">
<script src="https://ui-kit.prestashop.com/backoffice/latest/js/prestashop-ui-kit.js"></script>
[...]

Get Started

Include the dependencies: jQuery and Bootstrap PrestaShop UI Kit + Javascript.

[...]
<link href="dist/css/bootstrap-prestashop-ui-kit.css" rel="stylesheet">
<script src="dist/js/prestashop-ui-kit.js"></script>
[...]

Github dev Dependencies

pstagger

Contributing / Improving the UI Kit

Contributions are welcome!

You can check out an example of most of the included controls in this page. Check out a live example here.

Developing with PrestaShop

You can develop on your local copy of the UI kit and see how the changes work on PrestaShop. Assuming you already have a local copy of PrestaShop and of the UI kit installed on your computer (each on its own directory), here's what you need to do.

Open up admin-dev/themes/new-theme/package.json of your PrestaShop install, and look for "prestakit"

{
  // ...
  prestakit: "1.2.3";
  // ...
}

Change the version so it looks like this:

{
  prestakit: "/path/to/your/local/ui-kit";
}

Go back to to your UI kit folder and run

npm run watch

In another console, go to admin-dev/themes/new-theme/ of your PrestaShop install, and run:

npm install && npm run watch

If you keep both instances of NPM running, all your changes in the UI kit will be built automatically, as will your PrestaShop assets.

About PrestaShop

PrestaShop is a free and Open Source e-commerce web application written in PHP, committed to providing the best shopping cart experience for both merchants and customers. Learn more about PrestaShop

License

This UI Kit is released under the OSL-3.0 License.

prestashop-ui-kit's People

Contributors

aleeks avatar amaury-hanser avatar atomiix avatar dependabot[bot] avatar eternoendless avatar gfanton avatar hlavtox avatar jolelievre avatar julienbourdeau avatar kelu95 avatar kpodemski avatar mathiasreker avatar matks avatar matthieu-rolland avatar maximebiloe avatar mmoustai avatar nihco2 avatar pierrerambaud avatar progi1984 avatar quetzacoalt91 avatar shudrum avatar tomas862 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

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

prestashop-ui-kit's Issues

Usage in module

Is it possible to use this a module which uses Symfony pages for the back office without having to compile anything via npm?

If I add a component to my twig template, it seems to render as expected, however JS does not seem to work on it, for example, toggling behaviours do not work.

For example, when using a dropdown button and the button is clicked, the following JS error appears in the browser:

main.bundle.js:629 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'ownerDocument')
at P (main.bundle.js:629:6759)
at F (main.bundle.js:629:7163)
at e.W (main.bundle.js:629:8375)
at e.value (main.bundle.js:629:20374)
at main.bundle.js:629:346

Am I missing something?

Improvements: Removing link styling for links styled as button in alert

Hello there,
Sorry for the long title, but I couldn't find a way to phrase it better.

Issue:

When one uses an anchor tag <a> with the class .btn in an alert, the button will be underlined and the color won't be the one from the class .btn.

Markup:

<div class="alert alert-info" role="alert">
  <p class="alert-text">
    This is a info alert with <a href="#">an example link</a>. Click me to delete
  </p>
  <div>
    <a href="//google.com" class="btn btn-secondary">
      I'm an a tag
    </a>
  </div>
</div>

How it looks:

image

How it should look:

image

Fix suggested:

In _alert.scss, replace line 10:

From:

  a {

To:

  a:not(.btn) {

I can't think of any potential issue with this fix, let me know what you think about it.
Thank you :)

How to use it in our PS module ?

Hi,

in the README you say:

Note: If you use PrestaShop, there's no need to install – the UI kit is already installed in PrestaShop.

But when I copy/paste some code from http://build.prestashop.com/prestashop-ui-kit like the select box component into my configure.tpl file I get the old design and not the one from PSUI.

Do we have to do something special to use it in our module development ?

Regards

Issues in develop branch

I found some issues while browsing the preview on the develop branch:

  1. Low contrast link color in informational alert:

Screenshot 2020-08-03 at 17 07 59

  1. Blue link in green alert, again low contrast (and arguably ugly :P)

Screenshot 2020-08-03 at 17 08 44

  1. Low contrast in description text & icon color

Screenshot 2020-08-03 at 17 09 42

  1. The warning text is low contrast; the warning color background looks a little "muddy" to me, perhaps we should pick a more orangey yellow instead.

Screenshot 2020-08-03 at 17 10 14

  1. The warning badge looks even more muddy

Screenshot 2020-08-03 at 17 11 54

  1. The warning buttons suffer from the same color/contrast problems:

Screenshot 2020-08-03 at 17 12 40

  1. Again, low contrast:

Screenshot 2020-08-03 at 17 13 51

  1. Rounded background in the selected pill looks weird:

Screenshot 2020-08-03 at 17 14 52

Buttons: white text on cyan background fails the simplest contrast test (WCAG:AA)

Readability and accessibility

Readability and accessibility are paramount these days and companies get fined for not complying with accessibility basic rules (in the US and soon in Europe)

Acccessibility issue

The buttons used in PrestaShop UI kit fail the simplest contrast test (WCAG:AA) Foreground:#FFFFFF background:#2eb9d7

https://color.a11y.com/ContrastPair/?bgcolor=2eb9d7&fgcolor=ffffff

image

Fix proposition

One way to fix this would be to use the purple that's available in PrestaShop's colors #442CC7 ensuring a good contrast between the text and the background

https://color.a11y.com/ContrastPair/?bgcolor=442CC7&fgcolor=ffffff

image

prestashop admin theme conflicts (prestashop ui kit does not work properly)

What i did:
I opened this guide
Copied some sample code
Then pasted in configure.tpl of my custom module.

The result:
It has no effect. its like styles do not exist in prestashop admin theme.

Then what i did:
I downloaded prestashop ui kit with npm.
Added these lines:
<link href="{$css_dir}" rel="stylesheet">
<script src="{$js_dir}"></script>
It shows some changes but it has lots of conflicts with admin theme.

This is an image of what expected:
image

This is an image of result:
image

Operator outside calc scope

The file bootstrap-prestashop-ui-kit.css either from the npm repo or the cdn has an error.

height:calc(1.751rem + 2px)-2;

This causes that when you use a CSS preprocessor to make the kit works with your own custom modules.
#66 (comment)

This is the error that appears when you try to import it in a sass.
ima03fK57O

Replace tooltips icon

We are currently using the same icon for our tooltips and info alerts which is called "info". Also this icon looks a lot like the icon used for danger alert which is called "error". To prevent any type of dyslexia or to avoid confusing both icons between each other, it will be better to replace the tooltips icon by the one called "help". It's more representative of the feature.

See the difference

Before:
tooltips-before

After:
tooltips-after

btn-light has wrong text color

Problem
Button element in the UI kit has wrong color in btn-light variant.

Desired look
btn-light should have dark text.

How to reproduce
Insert <button type="button" class="btn btn-light">Light</button> anywhere in BO.

Screenshot
image

LICENSE file missing ?

package.json mentions OSL license but the file is not in the repo. Should we add the file?

Add a ColorPicker to UI Kit

After discussion with @MatShir, @PrestaShop/ux-team could you design a colorpicker ?

After that, I will work on its implementation. Thanks for advance

use github-pages to have a live overview

We should setup the main branch for "github-pages" feature, in order to provide a live overview.

Then we update the readme.md with a link. This way it will be easy for anyone to look at it, without using rawgit or other stuff like that.

Enhancement: size of the invalid state

Hello,

I suggest to increase the font-size of the validation message.
For now, the font-size compute to 10px.

It comes from the mixin @mixin ps-form-validation-state($state, $color) in scss/mixins/_forms.scss

@mixin ps-form-validation-state($state, $color) {
  .form-control.is-#{$state},
  .is-#{$state} {
    border-color: $color;

    &:focus {
      box-shadow: none;
    }
  }

  .#{$state}-feedback {
    margin-top: 0.3125rem;
    font-size: $font-size-xs;
    font-weight: $font-weight-bold;
    color: $color;
  }
}

The variable $font-size-xs is defined in scss/_variables.scss:
The value is:

$font-size-xs: 0.625rem; // PS custom

What do you think about increasing the computed value to 12px instead?

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.