Skip to content

Commit 5cd57e0

Browse files
authored
Fixed stoplight css scoping (#19)
1 parent 867cfa1 commit 5cd57e0

File tree

8 files changed

+10175
-17
lines changed

8 files changed

+10175
-17
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dist/"
1818
],
1919
"scripts": {
20-
"build": "tsc --project tsconfig.build.json && cp src/ContentDescriptor/ContentDescriptor.css dist/ContentDescriptor/",
20+
"build": "tsc --project tsconfig.build.json && cp src/ContentDescriptor/ContentDescriptor.css dist/ContentDescriptor/ && cp src/index.css dist/",
2121
"build:clean": "rimraf dist && yarn build",
2222
"build:docs": "typedoc",
2323
"link:setup": "rm -rf ./node_modules/react ./node_modules/react-dom",

src/ArrayFieldTemplate/ArrayFieldTemplate.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ T = any,
7373

7474
{canAdd && (
7575
<div className="col col--12" style={{
76+
padding: '0',
7677
justifyContent: 'end',
7778
display: 'flex'
7879
}}>

src/ContentDescriptor/ContentDescriptor.css

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
.glyphicon-plus {
2-
--b: 4px; /* the thickness */
3-
width: 40px; /* the size */
4-
aspect-ratio: 1;
5-
border: 10px solid #000; /* the outer space */
6-
background:
7-
conic-gradient(from 90deg at var(--b) var(--b),#000 90deg,#fff 0)
8-
calc(100% + var(--b)/2) calc(100% + var(--b)/2)/
9-
calc(50% + var(--b)) calc(50% + var(--b));
10-
display: inline-block;
11-
}
12-
13-
select, input {
1+
#method select, #method input, #interactive-box select, #interactive-box input {
142
border-radius: var(--ifm-global-radius);
153
border: 2px solid var(--ifm-toc-border-color);
164
font: var(--ifm-font-size-base) var(--ifm-font-family-base);
@@ -32,3 +20,9 @@ select, input {
3220
.method section {
3321
margin-bottom: var(--ifm-heading-margin-bottom);
3422
}
23+
24+
#interactive-box fieldset {
25+
border: none;
26+
margin: 0;
27+
padding: 0;
28+
}

src/ContentDescriptor/ContentDescriptor.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class ContentDescriptor extends Component<IProps> {
3030
/>
3131
)}
3232
{contentDescriptor.schema && (
33-
<JsonSchemaViewer schema={contentDescriptor.schema} />
33+
<div className="stoplight">
34+
<JsonSchemaViewer schema={contentDescriptor.schema} />
35+
</div>
3436
)}
3537
</div>
3638
);

src/FieldErrorTemplate/FieldErrorTemplate.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function FieldErrorTemplate<
1616
const id = errorId<T>(idSchema);
1717

1818
return (
19-
<div className="col col--12">
19+
<div>
2020
{errors
2121
.filter((elem) => !!elem)
2222
.map((error, index: number) => {

src/FieldTemplate/FieldTemplate.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function FieldTemplate<
3434
<WrapIfAdditionalTemplate {...props}>
3535
{displayLabel && <Label label={label} required={required} id={id} />}
3636
{displayLabel && description ? description : null}
37-
<div className='col col--12'>{children}</div>
37+
{children}
3838
{errors}
3939
{help}
4040
</WrapIfAdditionalTemplate>

0 commit comments

Comments
 (0)