Skip to content

Commit b8e3e36

Browse files
committed
add example theme style
1 parent e4f94ba commit b8e3e36

4 files changed

Lines changed: 93 additions & 0 deletions

File tree

styles/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ import publicStyles from "./public";
2323
import templateStyles from "./templates";
2424

2525
export default cssCombine(publicStyles, componentStyles, templateStyles);
26+
27+
// 专属主题样式
28+
export { exampleThemeStyles } from "./themes";

styles/themes/example/button.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*!
2+
* Copyright (c) https://github.com/lutinglt
3+
*
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
import { css, cssCombine, cssStyle, themeVars } from "@lutinglt/gitea-github-theme/core";
21+
22+
const exampleStyle = cssStyle({
23+
backgroundColor: themeVars.color.body,
24+
color: themeVars.color.text.self,
25+
padding: 16,
26+
"&:hover": {
27+
backgroundColor: themeVars.color.hover.self,
28+
},
29+
});
30+
31+
const exampleCSS1 = css`
32+
.ui.button {
33+
${exampleStyle}
34+
font-size: 16px;
35+
}
36+
`;
37+
38+
const exampleCSS2 = css`
39+
.ui.button {
40+
font-weight: 600;
41+
}
42+
`;
43+
44+
export default cssCombine(exampleCSS1, exampleCSS2);

styles/themes/example/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*!
2+
* Copyright (c) https://github.com/lutinglt
3+
*
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
import { cssCombine } from "@lutinglt/gitea-github-theme/core";
21+
import button from "./button";
22+
23+
export default cssCombine(button);

styles/themes/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*!
2+
* Copyright (c) https://github.com/lutinglt
3+
*
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
import { cssCombine } from "@lutinglt/gitea-github-theme/core";
21+
import example from "./example";
22+
23+
export const exampleThemeStyles = cssCombine(example);

0 commit comments

Comments
 (0)