Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable theme switching by html-prefix #15613

Merged
merged 1 commit into from Apr 5, 2019
Merged

Conversation

@krokofant
Copy link
Contributor

@krokofant krokofant commented Mar 24, 2019

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

馃懟 What's the background?

Ref NG-ZORRO/ng-zorro-antd#3110

Currently it is hard to switch between two ant themes using a prefix strategy because ant includes styles for the html selector which is the top-most element that one can style.

馃挕 Solution

Add a @html-selector variable so that one can override the html selector. This would allow for the following code to apply theme based on html-prefix:

html.first-theme {
  @import './themes/default';
  @import './core/index';
  @html-selector: &;
}

html.second-theme {
  @import './themes/default';
  @import './core/index';
  @html-selector: &;
}

And now we can preload all themes and switch between them by changing the class on html to .first-theme or .second-theme.

馃摑 Changelog description

Added @html-selector less variable to enable override of html selector to support theme prefix.

鈽戯笍 Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed
@netlify
Copy link

@netlify netlify bot commented Mar 24, 2019

Deploy preview for ant-design ready!

Built with commit 637b2e3

https://deploy-preview-15613--ant-design.netlify.com

@codecov
Copy link

@codecov codecov bot commented Mar 24, 2019

Codecov Report

Merging #15613 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #15613   +/-   ##
=======================================
  Coverage   94.49%   94.49%           
=======================================
  Files         250      250           
  Lines        6646     6646           
  Branches     1942     1944    +2     
=======================================
  Hits         6280     6280           
  Misses        365      365           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update f3c74c3...637b2e3. Read the comment docs.

1 similar comment
@codecov
Copy link

@codecov codecov bot commented Mar 24, 2019

Codecov Report

Merging #15613 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #15613   +/-   ##
=======================================
  Coverage   94.49%   94.49%           
=======================================
  Files         250      250           
  Lines        6646     6646           
  Branches     1942     1944    +2     
=======================================
  Hits         6280     6280           
  Misses        365      365           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update f3c74c3...637b2e3. Read the comment docs.

@afc163 afc163 merged commit 659efe0 into ant-design:master Apr 5, 2019
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants