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

Conversation

Projects
None yet
2 participants
@krokofant
Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Mar 24, 2019

Deploy preview for ant-design ready!

Built with commit 637b2e3

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

@codecov

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

27 of 29 checks passed

Header rules No header rules processed
Details
Pages changed 236 new files uploaded
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
CodeFactor No issues found.
Details
LGTM analysis: JavaScript No code changes detected
Details
Mixed content No mixed content detected
Details
Redirect rules 18 redirect rules processed
Details
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
Details
buildsize No change
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codebeat no reportable quality changes
Details
codecov/patch Coverage not affected when comparing f3c74c3...637b2e3
Details
codecov/project 94.49% remains the same compared to f3c74c3
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@weekly-digest weekly-digest bot referenced this pull request Apr 14, 2019

Closed

Weekly Digest (7 April, 2019 - 14 April, 2019) #16069

1 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.