Git Product home page Git Product logo

Comments (9)

danawoodman avatar danawoodman commented on June 24, 2024 1

That would be great! If I could pass in some props that would override the CSS classes that could be an option?

from react-password-strength.

danawoodman avatar danawoodman commented on June 24, 2024 1

I’ll see if I have some time to in the next days. Say a flag that is unstyled which is set to false by default?

from react-password-strength.

DennisKeulen avatar DennisKeulen commented on June 24, 2024 1

Same issue, stupid thing is in my dev build my own css works, but in production the build-in css overrules my css (given its the last css file in line).

How about passing the id/class that is now set as static ('ReactPasswordStrength')?
So make it set that class by default, if you want to not use it or use your own you can set it via props?

<ReactPasswordStrength customStyle="true">

if customStyle is not present, just set the className as 'ReactPasswordStrength'.
if that prop is present, dont add 'ReactPasswordStrength' so your build-in css will not be used and people have to write their own css for the id that you can already set in the input props.

from react-password-strength.

mmw avatar mmw commented on June 24, 2024

Yeah I can understand the frustration if you dont want to use the default styles. Will look into providing a fix for this issue.

from react-password-strength.

mmw avatar mmw commented on June 24, 2024

I was thinking easiest thing to do is pass a flag if you want the default CSS or not. If you have time/interest feel free to submit a PR otherwise I'll implement when I have time (buried in work atm)

from react-password-strength.

danawoodman avatar danawoodman commented on June 24, 2024

On another hand, being able to apply a class to the input field would mean one could use their existing .input class.

from react-password-strength.

luke-dare avatar luke-dare commented on June 24, 2024

As a quick fix, I'd suggest requiring that CSS is added manually as a separate import; that way it's easy to include / exclude styling as you wish.

from react-password-strength.

mmw avatar mmw commented on June 24, 2024

@luke-dare Im not a fan of that solution. Its a breaking change for something that shouldnt really need a breaking change and adds a second step to everyone who is using the tool as-is. Requiring CSS separately isnt something I've seen as a common practise.

Sorry I havent had time to look into this.. will see if I can find some time soon

from react-password-strength.

mmw avatar mmw commented on June 24, 2024

Took another look at the issues presented here, my feedback/response:

Right now there is no way to get the default CSS working without a lot of hard-coded when using a Bootstrap input

Integration with bootstrap (or any other css framework from a stylistic perspective) isnt a high priority for this. The goal is to have a super easy input component that rates password strength. I dont think the priority of bootstrap/foundation/etc integration will change in the future unfortunately.

RPS is an extremely simple component, the value it provides is the default styling that makes it easy to drop into a project. If you need more I would highly suggest implementing a custom component yourself in your project. Read the source code and you'll see how simple it is bc dropbox has done all the hard work with zxcvbn.

How about passing the id/class that is now set as static ('ReactPasswordStrength')?
So make it set that class by default, if you want to not use it or use your own you can set it via props?

This is the solution I've implemented to solve this through the namespaceClassName prop. If you change that it will update all the internal class names to use it (ex: ReactPasswordStrength-strength-desc becomes <namespaceClassName>-strength-desc) and you can provide your own styles w/o conflicts.

If you are bothered by the orphaned CSS just import the universal JS module instead (see docs). I havent tested this recently but it should work just fine. I've also updated the examples with a custom CSS example, if you need to change much more than this I think you're better off implementing zxcvbn in your project instead of using this tool.

Hope that helps!

from react-password-strength.

Related Issues (20)

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.