Skip to content

Commit

Permalink
[DM] rename .kss-* → .docs-* (#850)
Browse files Browse the repository at this point in the history
* delete unused _markup.scss file
* remove unused kss- things in html
* wholesale rename .kss-* => .docs-*
  • Loading branch information
giladgray authored Mar 16, 2017
1 parent b5fd8e6 commit 365c520
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 66 deletions.
2 changes: 1 addition & 1 deletion packages/core/examples/common/baseExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class BaseExample<S> extends React.Component<IBaseExampleProps, S

public render() {
return (
<div className={classNames("kss-example", this.className)} data-example-id={this.props.id}>
<div className={classNames("docs-example", this.className)} data-example-id={this.props.id}>
<div className="docs-react-example">{this.renderExample()}</div>
<div className="docs-react-options">{this.actuallyRenderOptions()}</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/src/common/cssExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const DEFAULT_MODIFIER: IKssModifier = {
export const CssExample: React.SFC<IKssExample> = ({ markup, markupHtml, modifiers, reference }) => (
<div>
{modifiers.length > 0 ? <ModifierTable modifiers={modifiers} /> : undefined}
<div className="kss-example-wrapper" data-reference={reference}>
<div className="docs-example-wrapper" data-reference={reference}>
{renderMarkupForModifier(markup, DEFAULT_MODIFIER)}
{modifiers.map((mod) => renderMarkupForModifier(markup, mod))}
</div>
<div className="kss-markup" dangerouslySetInnerHTML={{ __html: markupHtml }} />
<div className="docs-markup" dangerouslySetInnerHTML={{ __html: markupHtml }} />
</div>
);

Expand All @@ -31,7 +31,7 @@ function renderMarkupForModifier(markup: string, modifier: IKssModifier) {
}
});
return (
<div className="kss-example" data-modifier={modifier.name} key={modifier.name}>
<div className="docs-example" data-modifier={modifier.name} key={modifier.name}>
<code>{modifier.name}</code>
<div dangerouslySetInnerHTML={{ __html: html }} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/common/resolveExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface IExampleProps {
}

const Example: React.SFC<IExampleProps> = (props) => (
<div className="kss-example-wrapper">
<div className="docs-example-wrapper">
{React.createElement(props.component, { getTheme, id: props.name })}
<a className="view-example-source" href={props.sourceUrl} target="_blank">
<span className="pt-icon-standard pt-icon-code">&nbsp;</span>View source on GitHub
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/modifierTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function renderModifier(modifier: IKssModifier, index: number) {
}

export const ModifierTable: React.SFC<{ modifiers: IKssModifier[] }> = ({ modifiers }) => (
<div className="kss-modifiers">
<div className="docs-modifiers">
<table className="pt-table">
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/propsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const renderPropRow = (prop: IInheritedPropertyEntry) => {
};

export const PropsTable: React.SFC<{ name: string, props: IInheritedPropertyEntry[] }> = ({ name, props }) => (
<div className="kss-modifiers">
<div className="docs-modifiers">
<div className="docs-interface-name">{name}</div>
<table className="pt-table">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/styleguide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function queryHTMLElement(parent: Element, selector: string) {
* Returns the reference of the closest section within `offset` pixels of the top of the viewport.
*/
function getScrolledReference(offset: number, container: HTMLElement, scrollParent = document.body) {
const headings = container.queryAll(".kss-title");
const headings = container.queryAll(".docs-title");
while (headings.length > 0) {
// iterating in reverse order (popping from end / bottom of page)
// so the first element below the threshold is the one we want.
Expand Down
3 changes: 1 addition & 2 deletions packages/docs/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<title>Blueprint – Documentation</title>

<meta name="description" content="">
<meta name="generator" content="kss-node">

<link rel="stylesheet" href="docs.css">
<link rel="icon" href="assets/favicon.png" sizes="32x32" type="image/png" />
Expand All @@ -25,7 +24,7 @@
}
</script>
</head>
<body id="kss-node">
<body>
<div id="blueprint-documentation"></div>

<script src="docs.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function resolveInterface(name: string, key: React.Key) {
const Heading: React.SFC<{ depth: number, header: string, reference: string }> =
({ depth, header, reference }) => (
// use createElement so we can dynamically choose tag based on depth
React.createElement(`h${depth}`, { className: "kss-title" },
React.createElement(`h${depth}`, { className: "docs-title" },
<a className="docs-anchor" key="anchor" name={reference} />,
<a className="docs-anchor-link" href={"#" + reference} key="link">
<span className="pt-icon-standard pt-icon-link" />
Expand Down
26 changes: 11 additions & 15 deletions packages/docs/src/styles/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $example-background-color: $content-background-color;
$dark-example-background-color: $dark-content-background-color;

// title of a section
.kss-title {
.docs-title {
position: relative;
margin: $heading-margin 0 ($heading-margin / 2);

Expand Down Expand Up @@ -50,7 +50,7 @@ $dark-example-background-color: $dark-content-background-color;
}

&:focus,
.kss-title:hover & {
.docs-title:hover & {
opacity: 1;
}
}
Expand All @@ -61,7 +61,7 @@ $dark-example-background-color: $dark-content-background-color;
}

// modifiers table
.kss-modifiers {
.docs-modifiers {
margin-top: $heading-margin;
margin-bottom: $heading-margin / 2;

Expand All @@ -80,7 +80,7 @@ $dark-example-background-color: $dark-content-background-color;
}

// full-bleed wrapper for example
.kss-example-wrapper {
.docs-example-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
Expand All @@ -98,16 +98,8 @@ $dark-example-background-color: $dark-content-background-color;
}
}

.kss-markup {
width: 100%;

> pre {
margin: 0;
}
}

// example itself inside the wrapper
.kss-example {
.docs-example {
display: inline-block;
flex-basis: 100%;

Expand All @@ -126,8 +118,8 @@ $dark-example-background-color: $dark-content-background-color;
}

// modifier labels
.kss-modifiers code,
.kss-example > code {
.docs-modifiers code,
.docs-example > code {
display: inline-block;
line-height: 1.4;
white-space: nowrap;
Expand All @@ -150,6 +142,10 @@ $dark-example-background-color: $dark-content-background-color;
color: $class-modifier-color;
}

.docs-markup .editor {
margin: 0;
}

// additions to the syntax theme
.editor {
overflow: auto;
Expand Down
6 changes: 2 additions & 4 deletions packages/docs/src/styles/_examples.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ $options-margin: $pt-grid-size * 3;
}

.docs-overlay-example-transition {
$overlay-example-width: $pt-grid-size * 40;
$enter: (
transform: (translateY(-50vh) rotate(-10deg), translateY(0) rotate(0deg))
);
Expand All @@ -139,9 +140,6 @@ $options-margin: $pt-grid-size * 3;
$pt-transition-duration * 5,
$before: "&"
);

$overlay-example-width: $pt-grid-size * 40;

top: $overlay-example-width / 2;
left: calc(50% - #{$overlay-example-width / 2});
z-index: $pt-z-index-overlay + 1;
Expand Down Expand Up @@ -214,7 +212,7 @@ $options-margin: $pt-grid-size * 3;
line-height: $pt-navbar-height;
}

.kss-example-wrapper .pt-navbar {
.docs-example-wrapper .pt-navbar {
position: static;
}

Expand Down
30 changes: 0 additions & 30 deletions packages/docs/src/styles/_markup.scss

This file was deleted.

12 changes: 6 additions & 6 deletions packages/docs/src/styles/_sections.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// `.pt-fill` modifiers will always occupy an entire row.
// (Default styles give flex-basis of 100% to each example.)
@mixin examples-per-row($amount) {
.kss-example {
.docs-example {
flex-basis: floor(100% / $amount);
padding-right: $pt-grid-size * 2;

Expand Down Expand Up @@ -62,7 +62,7 @@
#{reference("pt-checkbox")},
#{reference("pt-radio")},
#{reference("pt-switch")} {
.kss-example {
.docs-example {
flex-basis: 10%;
}
}
Expand Down Expand Up @@ -105,22 +105,22 @@
#{reference("pt-select")} {
@include examples-per-row(4);

.kss-example {
.docs-example {
padding-right: 0;
}
}

#{reference("pt-select.pt-inline")} {
justify-content: initial;

.kss-example {
.docs-example {
flex-basis: $pt-grid-size * 25;
margin-right: $options-margin;
}
}

#{reference("pt-dialog")} {
.kss-example {
.docs-example {
height: $pt-grid-size * 27;
}

Expand All @@ -135,7 +135,7 @@
#{reference("pt-menu.pt-menu-header")} {
justify-content: initial;

.kss-example {
.docs-example {
flex-basis: $pt-grid-size * 15;
margin-right: $pt-grid-size * 8;
padding-right: 0;
Expand Down

0 comments on commit 365c520

Please sign in to comment.