]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
adds new clear button feature
authorRafiBomb <rafi@zurb.com>
Wed, 1 Feb 2017 22:29:46 +0000 (14:29 -0800)
committerRafiBomb <rafi@zurb.com>
Wed, 1 Feb 2017 22:29:46 +0000 (14:29 -0800)
docs/pages/button.md
docs/pages/css.md [new file with mode: 0644]
scss/components/_button.scss
scss/settings/_settings.scss

index 1b7318adf62ba0688c89342f669b38a8eee19a44..9819d099862facd78782f32af60ad1ad1736913d 100644 (file)
@@ -69,7 +69,7 @@ $button-palette: map-remove($foundation-palette, (
     primary,
     secondary
 )) !default;
-```  
+```
 
 Or you can add more colors to the default palette.
 
@@ -130,6 +130,27 @@ Add the `.hollow` class to a button to give it a hollow style. Change the `$butt
 <button class="hollow button" href="#" disabled>Disabled</button>
 ```
 
+---
+
+## Clear Style
+
+Add the `.clear` class to a button to give it a clear style. Change the `$button-fill` variable in your settings file to `clear` to make this the default style. Changing this setting will remove the `.clear` class from your CSS.
+
+```html_example
+<a class="clear button" href="#">Primary</a>
+<a class="clear button secondary" href="#">Secondary</a>
+<a class="clear button success" href="#">Success</a>
+<a class="clear button alert" href="#">Alert</a>
+<a class="clear button warning" href="#">Warning</a>
+<a class="clear button" href="#" disabled>Disabled</a>
+```
+
+<p>This is especially useful as a secondary action button. This way you get proper spacing and line-height. Example:</p>
+
+<button class="button primary" href="#">Primary Action</button>
+<button class="clear button" href="#">Secondary Action</button>
+
+
 ---
 
 ## Dropdown Arrows
@@ -141,11 +162,11 @@ Add a dropdown arrow to your button with the `.dropdown` class.
 </div>
 
 ```html_example
-<button class="dropdown button tiny ">Dropdown Button</button>
-<button class="dropdown button small ">Dropdown Button</button>
+<button class="dropdown button tiny">Dropdown Button</button>
+<button class="dropdown button small">Dropdown Button</button>
 <button class="dropdown button">Dropdown Button</button>
-<button class="dropdown button large ">Dropdown Button</button>
-<button class="dropdown button expanded ">Dropdown Button</button>
+<button class="dropdown button large">Dropdown Button</button>
+<button class="dropdown button expanded">Dropdown Button</button>
 ```
 
 ---
diff --git a/docs/pages/css.md b/docs/pages/css.md
new file mode 100644 (file)
index 0000000..3d0f951
--- /dev/null
@@ -0,0 +1,136 @@
+---
+title: CSS
+description: Here's the simplest way to get going. The straight CSS version of Foundation includes everything you need to start hacking away, right now! It's a perfect way to kickstart a new prototype or create a finished product with Foundation.
+previous:
+  url: flexbox.html
+  title: Flexbox
+next:
+  url: javascript.html
+  title: JavaScript
+videos:
+  -
+    title: CSS Version
+    desc: Getting Started with CSS Version
+    url: https://youtu.be/wHSwKCPXFcw
+---
+
+## Download and Install
+
+To get going with Foundation, simply download a default or custom CSS package from the download page.
+
+<a target="_blank" href="http://foundation.zurb.com/sites/download.html/" class="button">Download Foundation CSS</a>
+
+<hr>
+
+## Setting Up Your Project
+
+After downloading the css files, follow these simple steps to get started:
+
+### 1
+
+First, after you unzip the package, move the folder to your desired location and open it in a text editor. If you don't have one already, we use <a href="http://www.sublimetext.com/">Sublime Text</a> here at ZURB because it's very customizable, powerful, and simply rocks.
+
+
+### 2
+
+The `index.html` is your homepage. It has been linked up with foundation.css, normalize, and all the necessary JavaScript files for you. Just add your code between the `<body>` tags.
+
+### 3
+
+Next, you should create a new stylesheet and link it in the header of your HTML file, like so:
+
+
+```
+  <link rel="stylesheet" href="css/foundation.css">
+
+  <!-- This is how you would link your custom stylesheet -->
+  <link rel="stylesheet" href="css/app.css">
+
+  <script src="js/vendor/modernizr.js"></script>
+
+</head>
+```
+
+<div class="callout"><strong>Note:</strong> At ZURB, we call our custom stylesheets `app.css`. This is important for updating purposes: if you are going to add custom stylings to Foundation components, the code should be copied into your `app.css` file and edited there.</div>
+
+---
+
+## What You Get
+
+When you download the Foundation CSS package, you'll receive a .zip file that contains all the things you need to get started with Foundation. Below we explain every file in detail and how you can add your custom CSS.
+
+<div class="row">
+  <div class="medium-6 columns">
+    <div class="header-container">
+      <h3>Stylesheets</h3>
+    </div>
+    <ul class="info-list">
+      <li>
+        <strong>foundation.css</strong>
+        <p>The default CSS for Foundation is kept here. You can find the component and its settings there. You will use this file as you are developing because it's easier to read.</p>
+      </li>
+      <li>
+        <strong>foundation.min.css</strong>
+        <p>A minified, much smaller CSS file you can use if you don't need or want to pick apart the actual underlying Foundation CSS.</p>
+      </li>
+      <li>
+        <strong>normalize.css</strong>
+        <p>We've included a copy of Normalize here to give you the option to remove quirks in browsers so that all webpages render elements consistently. We recommend you use this because some Foundation styles are dependant on it.</p>
+      </li>
+    </ul>
+    <div class="header-container">
+      <h3>JavaScript</h3>
+    </div>
+    <ul class="info-list">
+      <li>
+        <strong>foundation.min.js</strong>
+        <p>If you are using any Foundation JavaScript components, this needs to be loaded on the page. We recommend at the end before your closing `<body>` tags like so:</p>
+        <img src="{{root}}assets/img/generic/js-cssversion.png" class="" height="" width="" alt="">
+      </li>
+      <li>
+        <strong>/foundation</strong>
+        <p>This is a directory that contains each plugin as a single JavaScript file, so you can check out the source code. And if you'd like, include certain ones but not others, or do your own minifying.</p>
+      </li>
+      <li>
+        <strong>/vendor</strong>
+        <p>This folder contains a few external JS files that Foundation makes use of including: Modernizr, another open-source tool from Paul Irish and Nicolas Gallagher, as well as jQuery 2.</p>
+      </li>
+    </ul>
+  </div>
+  <div class="medium-6 columns">
+    <div class="header-container">
+      <h3>Other</h3>
+    </div>
+    <ul class="info-list">
+      <li><strong>index.html</strong><p>This is an example index file which contains some sample markup (the grid, buttons, etc) as well as the basic structure of a responsive Foundation page. Feel free to change or destroy this file as you see fit, just bear in mind that some of the document ```<head>``` is required for the page to work including the CSS/JS that is linked up at the end of the document.</p></li>
+      <li><strong>humans.txt</strong><p>Located in the site root just next to the robots.txt file. You don't have to use if you don't want. You can mention the developer, the designer, the copywriter, the webmaster, the SEO, SEM or SMO. Name as many people who helped make the site, or not.</p></li>
+      <li><strong>robots.txt</strong><p>Website owners use the robots.txt file to give instructions about their site to web-crawling robots (also known as Web Wanderers, Crawlers, or Spiders). This is called The Robots Exclusion Protocol. Adding this page allows you to block web robots from indexing parts of your site. You can read more about it <a href="http://zurb.us/1jixgzu">here</a>.</p></li>
+    </ul>
+  </div>
+</div>
+
+---
+
+## Best Practices
+
+We have some best practice recommendations to help you optimize your experience with the Foundation CSS package.
+
+Making Changes to Foundation Default Stylings
+
+<div class="row">
+  <div class="large-7 columns">
+    <img class="round-margin" src="http://foundation.zurb.com/sites/docs/v/5.5.3/assets/img/images/using-css.png">
+  </div>
+  <div class="large-5 columns">
+    <p>In order to update your Foundation CSS when we release a new version, we recommend keeping your `foundation.css` file clean of any changes. Any components that you want to add your own stylings to should be copied to your `app.css` file where you can make changes there.</p>
+    <p class="subheader"><strong>Note:</strong> be sure to link the `app.css` stylesheet into the `<head>` of your file.</p>
+  </div>
+</div>
+
+---
+
+## HTML Page Markup
+
+As you'll see in our `index.html` sample, Foundation pages have some specific markup required for them to work. This code block is a simple boilerplate for content-free Foundation pages that we hope comes in handy.
+
+
index 9115adc07a920924576776837e02c5ee1a21a08e..222e6c0a7fa2dee8aca7b2c29a21f0e3e396f2fc 100644 (file)
@@ -42,6 +42,10 @@ $button-radius: $global-radius !default;
 /// @type Number
 $button-hollow-border-width: 1px !default;
 
+/// Border width for hollow outline buttons
+/// @type Number
+$button-clear-border-width: 1px !default;
+
 /// Sizes for buttons.
 /// @type Map
 $button-sizes: (
@@ -67,6 +71,10 @@ $button-background-hover-lightness: -20% !default;
 /// @type Number
 $button-hollow-hover-lightness: -50% !default;
 
+/// Color lightness on hover for clear buttons.
+/// @type Number
+$button-clear-hover-lightness: -50% !default;
+
 // Internal: flip from margin-right to margin-left for defaults
 @if $global-text-direction == 'rtl' {
   $button-margin: 0 0 $global-margin $global-margin !default;
@@ -158,7 +166,7 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !defau
 
 @mixin button-hollow-style(
   $color: $primary-color,
-  $hover-lightness: $button-hollow-hover-lightness, 
+  $hover-lightness: $button-hollow-hover-lightness,
   $border-width: $button-hollow-border-width
 ) {
   $color-hover: scale-color($color, $lightness: $hover-lightness);
@@ -172,6 +180,30 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !defau
   }
 }
 
+/// Removes background fill on hover and focus for hollow buttons.
+@mixin button-clear {
+  &,
+  &:hover, &:focus {
+    background-color: transparent;
+  }
+}
+
+@mixin button-clear-style(
+  $color: $primary-color,
+  $hover-lightness: $button-clear-hover-lightness,
+  $border-width: $button-clear-border-width
+) {
+  $color-hover: scale-color($color, $lightness: $hover-lightness);
+
+  border: $border-width solid transparent;
+  color: $color;
+
+  &:hover, &:focus {
+    border-color: transparent;
+    color: $color-hover;
+  }
+}
+
 /// Adds disabled styles to a button by fading the element, reseting the cursor, and disabling pointer events.
 /// @param [Color] $background [$primary-color] - Background color of the disabled button.
 /// @param [Color] $color [$button-color] - Text color of the disabled button. Set to `auto` to have the mixin automatically generate a color based on the background color.
@@ -285,6 +317,20 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !defau
       }
     }
 
+    // Clear style
+    @if $button-fill != clear {
+      &.clear {
+        @include button-clear;
+        @include button-clear-style;
+
+        @each $name, $color in $button-palette {
+          &.#{$name} {
+            @include button-clear-style($color);
+          }
+        }
+      }
+    }
+
     // Disabled style
     &.disabled,
     &[disabled] {
index 9f6743012518b45da90b2367337050145dff6355..d0e03a732801d6fb87a9e811f28b4b51abad577a 100644 (file)
@@ -99,6 +99,7 @@ $grid-column-gutter: (
   medium: 30px,
 );
 $grid-column-align-edge: true;
+$grid-column-alias: 'columns';
 $block-grid-max: 8;
 
 // 4. Base Typography
@@ -236,6 +237,7 @@ $breadcrumbs-item-color-disabled: $medium-gray;
 $breadcrumbs-item-margin: 0.75rem;
 $breadcrumbs-item-uppercase: true;
 $breadcrumbs-item-slash: true;
+$breadcrumbs-item-slash-color: $medium-gray;
 
 // 11. Button
 // ----------
@@ -248,6 +250,8 @@ $button-background-hover: scale-color($button-background, $lightness: -15%);
 $button-color: $white;
 $button-color-alt: $black;
 $button-radius: $global-radius;
+$button-hollow-border-width: 1px;
+$button-clear-border-width: 1px;
 $button-sizes: (
   tiny: 0.6rem,
   small: 0.75rem,
@@ -258,6 +262,7 @@ $button-palette: $foundation-palette;
 $button-opacity-disabled: 0.25;
 $button-background-hover-lightness: -20%;
 $button-hollow-hover-lightness: -50%;
+$button-clear-hover-lightness: -50%;
 $button-transition: background-color 0.25s ease-out, color 0.25s ease-out;
 
 // 12. Button Group