Giter VIP home page Giter VIP logo

Comments (8)

PeachScript avatar PeachScript commented on July 30, 2024 1

其实不太想占用 src 目录

不是组件库项目的 src,是主题包的 src

from dumi-theme.

xrkffgg avatar xrkffgg commented on July 30, 2024

@OrekiSH 你在改的时候, tsx 有动吗?还是只修改了 less ?

不知道引入后,打包 dumi 会不会 两份?

from dumi-theme.

OrekiSH avatar OrekiSH commented on July 30, 2024

不好意思没看到..

emm其实主要是因为我懒,不过的确有这个问题。个人理解可以给theme-defaultlayout.tsx加个prefix的prop, 后续子组件继承该prefix @PeachScript

dumi-theme-vuepress没动,只改了less。其他有些应该会改结构,感觉theme-defaultlayout.tsx的那些子块用render props会灵活点。css会两份一起打的 @xrkffgg

from dumi-theme.

OrekiSH avatar OrekiSH commented on July 30, 2024

大致是这个意思

import Layout from 'dumi-theme-default/src/layout';
import CustomNavbar from './components/CustomNavbar';
import './style/layout.less';
import './components/Navbar.less';
import './components/SearchBar.less';
import './components/SideMenu.less';
import './components/LocaleSelect.less';
import './components/SlugList.less';
import './builtins/Alert.less';
import './builtins/Badge.less';

export default function CustomLayout() {
  return (
    <Layout
      preifx="__dumi-vuepress"
      navbar-render={CustomNavbar}
    />
  );
};

from dumi-theme.

PeachScript avatar PeachScript commented on July 30, 2024

理解了,类似 antd 的 ConfigProvider,还是有些改造成本的

CSS 打两份的问题提个方案两位看下,新增主题包 src/index.less 的约定,和其他组件一样是增量覆写,这样 dumi-vuepress 一旦加载,默认主题的样式表就不会载入了

from dumi-theme.

xrkffgg avatar xrkffgg commented on July 30, 2024

其实不太想占用 src 目录

from dumi-theme.

OrekiSH avatar OrekiSH commented on July 30, 2024

我觉得可以,你们定呗theme也可以啊

from dumi-theme.

xrkffgg avatar xrkffgg commented on July 30, 2024

默认主题的样式表就不会载入了

这样就是需要全量处理一遍 less ?

from dumi-theme.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.