Git Product home page Git Product logo

sbuttons's Introduction

⚠️ This repository is now archived as I'm unable to maintain it moving forward. Thank you for everyone that contributed to this project!

sButtons

Logo made by Harshit Sharma

GitHub license CodeQL npm version PRs Welcome Open Source Love svg1 All Contributors

💡 Simple buttons you can use easily for your next project.

"Buy Me A Coffee"

Contents

Get Started with sButtons

Download CSS File

You can download the (CSS file)(https://raw.githubusercontent.com/sButtons/sbuttons/master/dist/sbuttons.min.css) and then add it to your HTML file in between the tags. Download the file and link it as a stylesheet in between your <head> tags, as shown below.

<link rel="stylesheet" href="/path/to/sbuttons.min.css" />

Make sure to replace "/path/to/sbuttons.min.css" with the path you stored it in.

CDN

Or instead of downloading the file, you can use the CDN.

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/sbuttons/dist/sbuttons.min.css"
/>

In case of using buttons that have icons in them, make sure to include font awesome's CDN in the <head> tag.

<link
  rel="stylesheet"
  href="https://use.fontawesome.com/releases/v5.14.0/css/all.css"
  integrity="sha384-HzLeBuhoNPvSl5KYnjx0BT+WB0QEEqLprO+NBkkk5gbc67FTaL7XIGa2w1L0Xbgc"
  crossorigin="anonymous"
/>

NPM

You can install sButtons using NPM:

npm i sbuttons

Using in CSS

You can import the CSS file found in dist/sbuttons.css or dist/sbuttons.min.css:

@import url("~sbuttons/dist/sbuttons.min.css");

Using in LESS

You can also import the less file found in src/sbuttons.less:

@import "~sbuttons/src/sbuttons.less";

Modify Colors

To modify button colors, import src/_variables.less in your less file, then make changes to the variables after the import. For example, to change the blue color to a different shade:

@import "/path/to/_variables.less";
@blue: #54a2bd; /* Make it darker */

Check out _variables.less for the full list of variables.

Usage

Basic Button

To use sButtons in your project, just add the classes of sButton you want to either <button> or <a> tags.

<button class="sbtn basic-btn blue-btn">Button</button>

You can find all classes mentioned in our Examples page.

Block Buttons

To use sButtons with block display, add the class to either <button> or <a>.

<button class="sbtn basic-btn blue-btn block-btn">Button</button>

Disabled Buttons

To make a <button> or <a> tag disabled, add disabled-btn class as shown below.

<button class="sbtn basic-btn blue-btn disabled-btn">Button</button>

Icon Buttons

The base-icon-btn class enables you to have a normal, customizable icon button. Using it, you decide to add any fontawesome icon in it. You can choose to either place it on the left or right side of the button with the available classes.

Only Icon

The icon-btn class alone gives you a default button with no background color and border.

<button class="sbtn icon-btn"><i class="fas fa-book"></i></button>

Icon Positioned to The Left

Adding the icon-left class to a button makes the icon positioned to the left.

<button class="sbtn base-icon-btn icon-left orange-btn">
  <i class="fas fa-book"></i>Read
</button>

Icon Positioned to The Right

Adding the icon-right class to a button makes the icon positioned to the right.

<button class="sbtn base-icon-btn icon-right orange-btn">
  Read<i class="fas fa-book"></i>
</button>

Toggle Button

The toggle-btn class, along with the toggle-off-btn / toggle-on-btn state class enables you to have a toggle button. Apart from the basic use, it can also be used for checkboxes and radio buttons. While not necessary, you can use the available state classes to choose whether your checkboxes and radio buttons are checked or not.

Toggle Button as Checkboxes

Adding the toggle-btn class to your checkbox inputs converts them to toggle buttons. For example:

<input type="checkbox" class="sbtn toggle-btn" />

Toggle Button as Radio Buttons

Adding the toggle-btn class to your radio inputs converts them to toggle buttons.

<input type="radio" class="sbtn toggle-btn" />

Rounded buttons

To add the rounded buttons with a particular radius, you can use various classes like rounded-x-btn where x is the radius in pixels which you want. Here x ranges from 5(border-radius = 5px) to fully rounded(border-radius = 50%).

<button class="rounded-5-btn sbtn blue-btn">Rounded button </button>

Animated Buttons

To use Animated sButtons in your project, add the classes of the animated sButton you want to either <button> or <a> tags.

<button class="animated sbtn atom-btn blue-btn">Animated Button</button>

Note: Depending on your button, the animation should either run infinitely or just once.

Dark Mode

sButtons is compatible with dark mode. It either works by adding dark-mode class to buttons, or by adding data-theme="dark" to a container element.

Using dark-mode Class

<button class="sbtn dashed-btn black-btn dark-mode">Dark-Mode</button>

Using data-theme attribute

By adding data-theme="dark" to a parent element like the body or a div element, the button will automatically be in dark mode.

<div data-theme="dark">
  <button class="sbtn dashed-btn black-btn">Dark-Mode</button>
</div>

Note: data-theme="dark" attribute does not give dark mode styling to the container element, you have to do that yourself. It only toggles sButtons to be in dark mode.

Contribution

Please see the contributing guidelines for details.

You can also join or start discussions with the community members if you have any ideas or questions!

Button ideas

If you would like to suggest a new button idea, please create a new discussion with the category "idea".

Projects Using sButtons

If your project uses sButtons, please submit it here to be added to the list of the websites using it!

Contributors

Check out our awesome contributors here!

LICENSE

MIT

sbuttons's People

Contributors

adsingh14 avatar alkatrivedi avatar allcontributors[bot] avatar arshdeepsingh98 avatar chaitanya4vedi avatar chiragkava avatar dependabot[bot] avatar divyanshutewari17 avatar dsnehasish74 avatar goodiec avatar hades-01 avatar harsh1868 avatar harsh1868-zz avatar heinkhantzaw avatar isonnymichael avatar jlambertazzo avatar justdoindev avatar kaf-lamed-beyt avatar lee00286 avatar mayankmohak avatar mrsidsat avatar neeraj15022001 avatar paresh-wadhwani avatar richieracoon avatar sanghvian avatar saumil-sh avatar shahednasser avatar snapecode avatar ub2906 avatar vinbaluyot 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

sbuttons's Issues

Replace website main color with CSS custom property

Currently in assets/css/index.css we're using #3a91ff for the main color. We are using this color for a couple of attributes, and we probably will be using it more.

Create the file assets/css/variables.css and add in it custom property --main-color on :root with the value #3a91ff then import this file in the beginning of assets/css/index.css and replace #3a91ff throughout the file with var(--main-color)

Change google font URL to include swap

Modify the URL for google font in index.html to include the display=swap attribute.

The font used for the website is Oleo Script Swash Caps. You can find the correct URL here

Add "How to Use" section to the website

At the top of the website, add "How to Use" section that demonstrates how to download or use the CDN for the CSS, and how to put it in the head tag of the page. Should be similar to the Usage section in README.

Sort buttons alphabetically

Currently, the list of buttons that are appearing on the website are in assets/js/buttons-examples.js in the variable buttons. We need this list sorted alphabetically, with the exception of "Basic Buttons" as it should be the first.
For example, now the list is "Basic Buttons", "Outline Buttons", "Hover Buttons", "Animated Buttons", etc.. It should become "Basic Buttons", "Animated Buttons", etc...
Also, sort the child types in each type (children of animated buttons or icon buttons)

Remove box shadow for click buttons

Currently, on click adds a box shadow to all button types. We need to remove this only for Animated Click buttons, as it changes the design of the button.

try adding something like box-shadow: none !important; for click buttons when it's :active or any good solution.
Make sure to read the contribution guide to learn how you can make changes properly.

Add message on clicking class names

When clicking on class names below a button it will be copied to the clipboard. Add a success message that indicates that the classes are copied. You can use something like bootstrap's Toasts or maybe just a tooltip over the element saying "Copied!"

Display code in how to use section using Prism.js

Currently, the code in "How to use section" is displayed as text like other text in the page.

Display it as a block of code by using Prism.js. Please make it as simple as possible. Use CDN and the designated classes for HTML code blocks.

Add a "Scroll to top" button

As the website can get lengthy, we need a button on the bottom right corner that appears after scrolling a little and that can take the user back to top on click.

Fix "Fill" rounded buttons on mobile

On mobile devices (specifically iPhone), when clicking on buttons of type "Fill" the overlayed color doesn't fully fill the container button.

Change color of yellow-btn for Fill Buttons

Currently, fill buttons of all types (fill button up, down, etc...) have text color set to #333, change it to the same yellow color as the button when it's not hovered, and then on hover use the #333.
Basically, when it's not hovered, it should look like outline button.

Add a note about using font awesome for some buttons

Currently, in our Usage docs and on the "How to Use" section of the website, we don't have a note about font awesome being needed for some buttons like Icon buttons and Social media login button.

Add a little explanation of when font awesome is needed and include a code block of adding font awesome using their cdn. It should be added to both README and "How to Use" section.

Modify How to Use section's text

Make the following changes to the section:

  1. Change "The CSS file is available for download here.
    Download the file and link it as a stylesheet in between your tags, as shown below." to "You can download the CSS file here and then add it to your html file inbetween the tags:" make sure the "here" points to the URL to download the CSS file.
  2. Change "You can copy the sentence above, and replace the "/path/to/sbuttons.min.css" with the proper path to where you have the file stored." with "Make sure to replace "/path/to/sbuttons.min.css" you stored it in"
  3. Change "Additionally, you can also use the buttons by using the CDN. You can directly copy the line below and place it inside your tags, just like you would if you were to download the file." to" Or instead of downloading the file, you can use the CDN:"

Click button animation style

CHANGE IN CLICK BUTTON STYLE
I guess Click button that u have made will look much better if it would be like
this one :
click_button
rather than this one :
click_2

Additional notes

Sort buttons appearing under types alphabatically

For example, under the "Animated Buttons" type we have fill in right, scale, click, etc...
Currently, they're not alphabetized. Just make changes in index.html to reorder them in alphabetical order.
Make sure to also update the links in the sidebar.

Navigating onclick sidebar

Describe the bug
I found bug on navigate sidebar, when I click the sidebar, the content is not full covered.
Screenshot_1

Expected behavior of what should have happened (if applicable)
It should be like this
Screenshot_2

Disable selection of logo text

Add a rule to .logo h1 to disable user selection. Make sure to add the changes to assets/css/index.css. Check out the screenshot for an example
sButtons-Simple-and-Creative-Buttons

Add hamburger side menu on mobile devices

Add a menu icon that only appears on mobile devices (less than 768px of width) and add the appropriate css or js to make the menu icon toggle the existing sidebar menu.
As bootstrap is used in this website, you can also use bootstrap to do this functionality.
Font awesome is also used on the website so you can use it for the hamburger menu icon.

Active sidebar not pointing on right content

Describe the bug
When I click the sidebar menu, the active sidebar is not pointing on right content.
Screenshot_1

Expected behavior of what should have happened (if applicable)
The active sidebar menu must pointing on right content.
Screenshot_2

Screenshots (if applicable)

Additional notes

Add button ideas

There's now a new page for button ideas where you can add ideas that you would like to see implemented. If you have any ideas that you are not able to implement for any reason, please add them there.

If you would like to check button ideas to implement, make sure to look there, and follow the contibuting guidelines to implement the idea and check it off.

Add light/dark mode

Add a toolbar that switches between light and dark mode. The toolbar can be placed in any place as long as it doesn't interfere with the content of the website.

Light mode should be the default, which is what the website looks like now. Dark mode should just change the background to a dark color and change sidebar menu links or header links to a light color. Don't make any changes to the buttons for now.

When creating the toolbar, try to make it something simple. I think it would be best if you can use icons to signify Light and Dark modes. We are already using font awesome on the website, so maybe use a "sun" icon for light, and "moon" icon for dark.

Add Social Login buttons under "Social Buttons" type

Add login buttons for different social platforms. It can be for instagram, github, linkedin, or any other social media platform.
You don't have to add all types you can add as many as you want.
Please make sure to utilize the social platform's main color when making the button. You can see current buttons on the website for examples. As for the icons in the button, you can find them on font awesome.
Add new buttons under src/components/social/ and name it _<social_platform_name>.less and import it in src/components/_social.less

Add .hover class for force button hover appearance

:hover is not trusted attribute so You can't set it programmatically (ex. using JS).
We can add a CSS class to handle this state.
It can be used for button hover animation, for triggering from another hover, etc.

This solution is used, for example, in bootstrap buttons (.active class).

If you think the idea is good, I can work on it. Just assign me :)

Add New Buttons

First-time contributors are welcome!
Add new button styles that you find helpful.

Currently, there are the following button style types:

  1. Basic: Normal looking buttons
  2. Button Styles: styles for the buttons
  3. Animated: Different animations for buttons.
  4. Hover: Buttons that have a hover effect
  5. Icons: Buttons that have icons in them.
  6. Social Buttons: Login buttons for different social media platforms
  7. Special Buttons: buttons that have a special twist to them.

Either add something under those types or create new ones.
You can check the current ones on the website.
For some help on how to add or change button styles, you can learn more on the contributing guide

To check for new ideas added by contributors to implement, check the button-idea label and the ideas in discussions.

To submit a new button idea, please create a new discussion under the ideas category.

Add favicon

Currently, we don't have a logo (if you want to add a logo check out issue #2 ). For now, we just need a favicon. Something simple and nice. Could be an emoji or any modern icon.
When sending the pull request, make sure to include an image of the favicon in the pr.

Add tagline under logo

Add a tagline under the logo that says "Made with ❤︎". Either use a sans-serif font (not the current font being used for the logo) or find something on Google Fonts.

Any style additions you make, please add them in assets\css\index.css. If you add a Google Font, add it at the end of the <head> tag.

Assign correct labels based on issue

I want to add labels to issues to differentiate between issues directed towards website and those towards buttons. Please do not start working on this issue before commenting about it, as it can cause a mess. After commenting on her and getting approval, you can go ahead and work on it. Once you're done, leave a comment saying so.
Make sure to read the README and contribution guide before working on this to get an idea of where each issue belongs.

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.