Skip to content

Commit

Permalink
Add styling to parent links of current link
Browse files Browse the repository at this point in the history
  • Loading branch information
lord committed Mar 2, 2017
1 parent 4aae61a commit 7090d80
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
50 changes: 50 additions & 0 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,53 @@ Parameter | Description
--------- | -----------
ID | The ID of the kitten to retrieve

## Delete a Specific Kitten

```ruby
require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.delete(2)
```

```python
import kittn

api = kittn.authorize('meowmeowmeow')
api.kittens.delete(2)
```

```shell
curl "http://example.com/api/kittens/2"
-X DELETE
-H "Authorization: meowmeowmeow"
```

```javascript
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.delete(2);
```

> The above command returns JSON structured like this:
```json
{
"id": 2,
"deleted" : ":("
}
```

This endpoint retrieves a specific kitten.

### HTTP Request

`DELETE http://example.com/kittens/<ID>`

### URL Parameters

Parameter | Description
--------- | -----------
ID | The ID of the kitten to delete

5 changes: 4 additions & 1 deletion source/javascripts/app/_toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@

var $best = $toc.find("[href='" + best + "']").first();
if (!$best.hasClass("active")) {
// .active is applied to the ToC link we're currently on, and its parent <ul>s selected by tocListSelector
// .active-expanded is applied to the ToC links that are parents of this one
$toc.find(".active").removeClass("active");
$toc.find(".active-parent").removeClass("active-parent");
$best.addClass("active");
$best.parents(tocListSelector).addClass("active");
$best.parents(tocListSelector).addClass("active").siblings(tocLinkSelector).addClass('active-parent');
$best.siblings(tocListSelector).addClass("active");
$toc.find(tocListSelector).filter(":not(.active)").slideUp(150);
$toc.find(tocListSelector).filter(".active").slideDown(150);
Expand Down
2 changes: 2 additions & 0 deletions source/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $code-bg: #292929 !default;
$code-annotation-bg: #1c1c1c !default;
$nav-subitem-bg: #262626 !default;
$nav-active-bg: #0F75D4 !default;
$nav-active-parent-bg: #262626 !default; // parent links of the current section
$lang-select-border: #000 !default;
$lang-select-bg: #222 !default;
$lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something
Expand All @@ -45,6 +46,7 @@ $search-notice-bg: #c97a7e !default;
$main-text: #333 !default; // main content text color
$nav-text: #fff !default;
$nav-active-text: #fff !default;
$nav-active-parent-text: #fff !default; // parent links of the current section
$lang-select-text: #fff !default; // color of unselected language tab text
$lang-select-active-text: #fff !default; // color of selected language tab text
$lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed
Expand Down
6 changes: 6 additions & 0 deletions source/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ html, body {
color: $nav-active-text;
}

// this is parent links of the currently selected ToC entry
.toc-link.active-parent {
background-color: $nav-active-parent-bg;
color: $nav-active-parent-text;
}

.toc-list-h2 {
display: none;
background-color: $nav-subitem-bg;
Expand Down

0 comments on commit 7090d80

Please sign in to comment.